Click here to Skip to main content
15,900,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

i am using a file upload control in my project.
I just want to open specific virtual directory everytime on click of browse button of file upload control.

Can anyone suggeset on the same.

Thank you,

Regards,
Vamshi.
Posted

1 solution

If it's a winforms project then this will help you (the InitialDirectory property).

If it's a web form, then I don't believe this is possible as it would present a security risk. (it could possibly be used to detect the presence of a given directory on a website visitor's machine)
 
Share this answer
 
Comments
vamshi.k.choutpally 8-Oct-10 4:21am    
I believe this is possible in case of Web Application as well. Also to avoid the security risk in case of virtual directory you just create a seperate virtual directory for all the contents which you want to expose and then enable directory browsing for it. But how to open the directoty on click of browse button of file upload control, that is where i got stuck ... any more ideas.
Nathan St 8-Oct-10 5:18am    
For a web application, the html fileupload element will be giving the user a view of their local file system. You refer to enabling directory browsing in your comment above, that is not relevant to this scenario. See <a href="http://www.velocityreviews.com/forums/t156157-default-folder-for-file-select-form-input.html">here</a> for a discussion on the topic of setting a default directory. Good Luck! :)
Nathan St 8-Oct-10 5:18am    
oops, sorry about the html in the comment. link is http://www.velocityreviews.com/forums/t156157-default-folder-for-file-select-form-input.html

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900