Click here to Skip to main content
15,891,607 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I used the input element with the type="fie" to create a file browser.
I need to know if there is a possible way to set a default directory,so that when i press 'browse' this exact directory will open (let say c:\windows\)

Thanks in advance,
Yaniv
Posted
Comments
Ankur\m/ 27-Sep-10 6:47am    
The answerer will never know about your question you asked him if you choose 'add answer'.
'Add Comment' is what you should use to discuss with an answerer.

1 solution

I guess this is not possible.

The reason is, the File upload control runs in client's Browser. A client could have differences in their disk organization and folder hierarchy, they could have different OS (Which might not have the drive concept). So, even if a default folder is set for the file upload control from the server's code (Or, using the client side scripting), it would have failed for most of the clients.

So, unfortunately, it seems you can't do that.

However, the file browser window might be able to remember the folder location of the previous file selection. Not sure whether this is handy for you or not.
 
Share this answer
 
v2
Comments
Ankur\m/ 27-Sep-10 6:12am    
Perfect! :thumbsup:
Al-Farooque Shubho 27-Sep-10 6:14am    
Thanks, bro!
Ankur\m/ 27-Sep-10 6:44am    
[moved from answer]
kh_yaniv wrote:
"However, the file browser window might be able to remember the folder location of the previous file selection. Not sure whether this is handy for you or not."

do you know where the old path saved?
(maybe i can change this attribute and my default path will be opened)
Al-Farooque Shubho 27-Sep-10 6:46am    
This is entirely handled by the browser or the internal implementation of the ActiveX control. I guess you can't change this.

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