Link to home
Start Free TrialLog in
Avatar of Fred Goodwin
Fred GoodwinFlag for United States of America

asked on

File upload browse path

I have a file upload section on my page.  What I would like to do is when the user hits browse I want the browse window to open to a specific location.  For instance when they hit browse I want the window to open having navigated to C:\pictures\New.  I am writing this in asp.net but the controls are all html so i dont think that there is anything I can do in asp.net to help this.

Thanks for the help
ASKER CERTIFIED SOLUTION
Avatar of knightEknight
knightEknight
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
This is for security reasons, otherwise some evil hacker could do this:

<BODY onload="document.myForm.submit();">
<FORM name="myForm" action="getPasswords.cgi">
  <INPUT type="file" value="C:\\windows\\passwords.txt" />
</FORM>
</BODY>
heres the thing - what if the user doesnt have a folder named New in a directory named pictures on their c drive?  The browse window opens up the directories on the USER's PC, not yours - so setting a default path is not possible (what if they named their harddrive d or e?).  Sorry, but as knight said, it cant be done.
Or even this, which could be far more devestating:

<FORM name="myForm" action="getBlackBook.cgi">
  <INPUT type="file" value="C:\\windows\\From-when-I-was-Single.txt" />
</FORM>
</BODY>

I shudder at the thought...
yeah, and just think how the people on that list would feel!
Avatar of Fred Goodwin

ASKER

In my case this is on the intranet and its for a local app.  I dont want to select the file just open the browse to a specific folder and let the user select the file from there.  Any other ideas how I might be able to do this or is there still no way?

Thanks for the help
there is still no way because it is the same mechanism, sorry.
I agree that this would be a nice feature though.  There may be some other proprietary controls you can use for this.
WSH and the filesystem would do it

Can you give me more detail?
Perhaps here. I would think you can find what mostly resembles your situation and the perhaps post again if you need more help
http://www.google.com/search?q=wsh+file+upload
http://groups.google.com/groups?q=wsh%20file%20upload