Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.net - Multiple Upload with jQuery Multiple File Upload Plugin

I know how to upload with ASP.net's FileUpload control.

What I want to do is use this jQuery Multiple File Upload Plugin to upload multiple files.

Here is exactly what it does when multiple files are selected for upload:

<input type="file class="multi MultiFile" id="MultiFile1_F3" name="file1[]" style="position: absolute; top: -3000px;">

But I cannot figure out how to manipulate these files from asp.net. I have tried using Request.Files as the following link instructs: ASP.Net Upload of multiple files after choosing them from jQuery

That doesn't work. I think that only works for controls marked with runat="server" at compile time.

Does anyone know how to do this? Maybe something in Request.Form...?

Thanks for your help!

like image 862
Ronnie Overby Avatar asked Feb 18 '09 20:02

Ronnie Overby


1 Answers

Two things to check:

  • Make sure your form has the enctype="multipart/form-data" attribute set. This is required to enable uploads.
  • Make sure all file inputs have both id and name attributes set. For some reason, if you don't set both, wierd things happen.

Also, runat="server" shouldn't have anything to do with whether Request.Files works or not -- this is more an issue of the browser actually posting the files.

like image 157
Chris Hynes Avatar answered Sep 19 '22 14:09

Chris Hynes