Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Downloading An Unknown File to a Specific Location

Status
Not open for further replies.

yacyac

Programmer
Jul 29, 2002
78
US
I know how to download a specific file to a designated location. But my users chose the file to download, right-click on it and chose save target as - how can I control what the default download directory is?
Thanks in advance
 
Sounds like you are talking about downloading a file from the web, in which case this is the wrong forum.

If your application really is built with classic VB 5 or 6, then whichever of the several ways you might be doing this, you should already have that information in your code.


 
Sorry but your answer makes no sense to me. Yes I am talking about downloading a file from the Web using my VB6 program. I guess I didn't make that point clear. I send the user to a website where they have a choice of files to download, once they select a file and right-click they receive the normal pop up window and they select save target as - at this point a dialog box opens and they are asked where to save it to - the dialog box is not controlled by me, but I would like to be able to set the default directory - from inside my VB program. Can this be done? If so can some one point me in the right direction. I was hoping that there would be a CSIDL I could use, but it appears that the last place saved to is saved in Windows somewhere.
 
JoeAtWork was querying whether you were really doing this from VB, and suggesting that if you were then you should have all the info you need.

You then respond that yes, you are doing it all from Vb ... except that you are not (at least, not from your description); you are simply using VB to select a webpage. After that it is IE that controls the shots ...


To change the default download directory used by IE, you need to modify the registry. The key you are interested in is:

HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Download Directory

Note that this is a GLOBAL setting, so users may get upset if you change this without telling them or providing the facility to restore things to their original status after your application ahs done it's bits.
 
Strongm
Thanks - that key was just what I needed. I had all intentions of returning the key back to what it was after my download was complete.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top