2

I'm trying to upload some files to an ftp server from an ASP.NET page. Everything is ready however I would like to use an open file dialog to select the files I want to upload. How can I enable file upload to select multiple files, and if I can't, can I simply use the OpenFileDialog like a normal windows forms application ?

Thanks in advance

6 Answers 6

2

The issue is that in the context of a web application, you post data as a KeyValuePair. So a single <input type="file" name="Something" /> element can contain only one file because it is only one key.

An OpenFileDialog would be executed server side in a window there; the client would never see it.

Your options are to either limit to 1 file (and have a button to add another file upload), or move to a gmail like approach where you use a flash / plugin to get that functionality.

Sign up to request clarification or add additional context in comments.

Comments

2

The standard HTML browse dialogue won't let you. However, there's a video on the official ASP.NET site called Multiple File Uploads in ASP.NET 2 that you should look at. There's some code based on that here.

Generally you would either use a Flash or JavaScript/AJAX based solution. There are plenty of controls available that can do this eg.

Just google 'multiple file upload' for far more.

Comments

0

Set OpenFileDialog's MultiSelect property to true.

Comments

0

You may want to look at these SO posts:

How to select multiple files for upload?

Selecting Multiple Files for Upload in Web Page

Comments

0

Have a look here on how to upload multiple files. You have multiple FileUpload controls and use HttpFileCollection to get the files.

http://www.dotnetcurry.com/ShowArticle.aspx?ID=68&AspxAutoDetectCookieSupport=1

Comments

0

i also research on this point but there is no a way to select a multiple file at one file control beacuuse the limitation of the file controll is select only one file at the time so you will take multiple file control for import multiple file

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.