从未上传过文件/图片:)
再次,将尝试尽可能多地解释..
有一个MVC3应用程序。 用户需要选择上传图像,根据需要裁剪,然后将其保存为db中的byte []。
非常感谢任何帮助,告诉你如何上传图像,裁剪它(jQuery),将其作为byte []发送到服务器,然后在用户登录时检索以供查看。
看了jCrop,但我不知道如何上传图像,并将其加载到HTML文件中供jCrop使用。
如上所述,使用MVC3与Razor视图引擎。
编辑:
使用了以下ViewPage代码:
<form action="/home/index" method="post"> <input type="file" name="file" /> <input type="submit" value="upload" /> </form>以及以下控制器动作
[HttpPost] public ActionResult Index(HttpPostedFileBase file) { return View(); }但参数'file'为空
Have never uploaded a file / image :)
again, will try to explain as much as possible..
Have a MVC3 application. the user needs to have the option to Upload a Image , crop it as required and then it should be saved as byte[] in db ..
would appreciate any help for telling how to upload a image, crop it (jQuery), send it to server as byte[] and then retrieve later for viewing when user logs in ..
have looked at jCrop but am not aware of how to upload an image, and load it in the HTML file for jCrop to use.
As said, using MVC3 with Razor view engine.
EDIT:
Have used the following ViewPage code:
<form action="/home/index" method="post"> <input type="file" name="file" /> <input type="submit" value="upload" /> </form>And the following controller Action
[HttpPost] public ActionResult Index(HttpPostedFileBase file) { return View(); }but the parameter 'file' is null
最满意答案
谢谢你的支持 ..
已经解决了使用System.Web.Helpers管理控制器上的图像接收并使用其方法从Jcrop接收坐标后裁剪图像的问题。然后再次使用webhelper函数将Image转换为byte []。 。
谢谢你的亲切建议..
Thank you for the support ..
have solved the problem using System.Web.Helpers for managing image receipt at the controller and using its method to crop an image after receiving the co-ordinates from Jcrop .. Then again using a webhelper function to convert the Image to byte[] ..
thank you for the kind suggestion though ..
更多推荐
MVC,file,byte,jCrop,电脑培训,计算机培训,IT培训"/> <meta name="descripti
发布评论