图像上传和mvc3中的裁剪(image upload and cropping in mvc3)

编程入门 行业动态 更新时间:2024-10-26 06:26:06
图像上传和mvc3中的裁剪(image upload and cropping in mvc3)

从未上传过文件/图片:)

再次,将尝试尽可能多地解释..

有一个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

本文发布于:2023-08-05 05:45:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1428471.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:图像   上传   cropping   upload   image

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!