开发者

Multiple file uploads asp.net mvc

I am facing one serious problem

Technology: Asp.net mvc

开发者_StackOverflowI am trying to upload multiple files from the dynamically created file upload control from javascript.(Attach more file Options).My files are not getting posted to the mvc controller action.i have specified the propert new { enctype = "multipart/form-data" } in my form still the file is not getting posted.

NB:

1)The file from the first file upload control(which is shown on the first page load is getting posted but the rest which is added using attach more file option is not getting posted)

Many Thanks in advance.


I am using with asp.net mvc for multiple file upload this jquery plugin and it works well: http://www.fyneworks.com/jquery/multiple-file-upload/

In the view you have to include something like this:

<input name="attachments" type="file"/>

And then you have to make an action method in the controller that waits for List<HttpPostedFileBase> attachments

If you can not make your current solution to work this plugin worth a try....


MVC has no built-in way to upload multiple files at once, other than to have multiple <input type="file" /> elements in your page.

You will probably want something a little more advanced, so you can use any number of jQuery plugins that do this, such as http://www.fyneworks.com/jquery/multiple-file-upload or http://www.uploadify.com/

Once the files are uploaded, then you can convert them to thumbnails using any of a number of techniques, some using third party libraries, some using built-in code.. there's lots out there if you look for them.

Here's a nice tutorial with a lot of what you need.

http://www.codeproject.com/Articles/379980/Fancy-ASP-NET-MVC-Image-Uploader

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜