文件上传与其他领域表单的一部分 [英] File Upload as Part of Form with Other Fields
问题描述
我有一个ASP.NET MVC的网站。我需要一个页面,用户必须输入几个领域,包括图像文件。
I have an ASP.NET MVC website. I need a page where the user must enter several fields, including an image file.
我能找到上传使用MVC的文件很多,很多引用。但他们不将文件上传与其它字段的表格的一部分。
I could find many, many references for uploading a file using MVC. But they don't upload the file as part of a form with other fields.
理想情况下,字段和文件将被发送到一个控制器。任何提示?
Ideally, fields and file will be sent to a single controller. Any tips?
推荐答案
您可以使用 FineUploader 。 见演示
Valums上传。它采用纯JavaScript(使用iframe上传文件)
Valums Uploader. It uses pure Javascript (uploads file using Iframe)
您可能需要使用客户端插件。 Plupload 是一种可能的选择。和<一个href=\"http://stackoverflow.com/questions/4444955/how-to-use-the-plupload-package-with-asp-net-mvc/4447694#4447694\">here's如何你可以在你的MVC应用程序将它集成一个例子。支持此功能的另一种流行的插件是 Uploadify 。
You might need to use a client plugin. Plupload is one possible choice. And here's an example of how you could integrate it in your MVC application. Another popular plugin which supports this functionality is Uploadify.
看到进步演示1,2及3在 http://jquery.malsup.com/form/#file-upload
See Progress Demo 1, 2 & 3 at http://jquery.malsup.com/form/#file-upload
参考:<一href=\"http://forums.asp.net/t/1897410.aspx/1?MVC4%20File%20Upload\">http://forums.asp.net/t/1897410.aspx/1?MVC4+File+Upload
这篇关于文件上传与其他领域表单的一部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!