views:

788

answers:

3

The file upload control in asp.net does not allow me to select a folder and enables me to select only the files. Is there any way in which I can select a folder (obviously without using the file upload control).

Why I want to select the folder is basically to store its entire path in a database table.

+1  A: 

No, browsing for files are the client-side feature, and the only information about file path is their name. It's cause security.

TcKs
+1  A: 

I dont think HTML supports what you are trying to do. Perhaps as a workaround you can have them select a file in the folder and then chop off the file name when processing it but thats a mess to be honest.

Ask them to Paste or type the path into a textbox perhaps. The issue here is you cant check for typos.

Id say you should rethink what you are trying to do.

Kaius
+2  A: 

The HTML <input type=file> element only supports single file uploads. If you to have multiple file upload, you would have to use a 3rd party component - usually written in Flash.

Here an example: http://www.codeproject.com/KB/aspnet/FlashUpload.aspx

jop
Also check out SWFUpload
John Sheehan