views:

40

answers:

3

uploading multiple files from client to server with asp.net

I have been looking at the asp.net upload control but that is for one file (unless someone knows a better way to do it).

http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.fileupload.aspx

For what I want to do I don't even really need a browse. I know the files off of the client are at a certain location. Is it possible to create a collection of *HttpPostedFile*s and upload those?

http://msdn.microsoft.com/en-us/library/system.web.httppostedfile.aspx

I don't think it is possible but would be glad to be proven wrong. Is there a different asp.net method or control that will easily allow uploading multiple files from client to server?

A: 

The only multiple file upload component I know from the top of my head is the one Telerik provides: http://www.telerik.com/products/aspnet-ajax/upload.aspx

That's bundled in RadControls, which is a pretty nice kit to have, though it costs a bit.

Marcus L
A: 

Have a look at the System.Net.WebClient.UploadFile and System.Net.WebClient.UploadFileAsync methods.

If you use the synchronous method, you would upload one file at a time sequentially. If you opt for the asynchronous method instead, you could fire off multiple uploads at once.

Enrico Campidoglio