|
-
Oct 13th, 2000, 03:37 PM
#1
Thread Starter
New Member
I am using the URLDownloadToFile api function to get a file from an FTP server. Everything seems to work ok except a couple of things.
1. Everything I download ends up in Temporary Internet Files as well as the location I specified. Then the next time I attempt the download it simply returns the cached version. How can I force the files not to be cached?
2. Does anyone have an example of how to use the StatusCalleback part of the call to implement a progress bar for each download.
Thanks in advance,
-
Oct 13th, 2000, 04:38 PM
#2
Fanatic Member
I'm not sure how you could prevent it from caching...but you could delete the temporary files after the download is complete.
Code:
Kill "C:\Windows\Temporary Internet Files\" & FileDownloaded
'I'm sure you have the filename stored as a string someplace so just place it in the above code.
'If not then use this to clear the Temp Dir.
Kill "C:\Windows\Temporary Internet Files\*.*"
Gl,
D!m
-
Oct 13th, 2000, 06:46 PM
#3
Thread Starter
New Member
D!m,
I thought about that but I run into a problem on Win2000 machines for sure, maybe NT4 as well. In 2000 the cache folders are user specific and therefore I don't know where to go to delete the files.. Any other ideas?
Thanks
-
Oct 14th, 2000, 01:50 AM
#4
Fanatic Member
Even if the cache(s) in those OS's are user specified, there has to be some reference to them. Most likely there's a registry entry telling the system where the user specified the dir. I wish I could tell you where though. My use of the registry is very limited so far, but this could help you a little.
I'm baaaack...
VB5 Professional Edition, VC++ 6
Using a 1 gHz Thunderbird, 256 mb RAM, 40 gb HD system with Win98se
I feel special because I finally figured out how to loop midis: Post link
I'm a fanatic too 
-
Apr 13th, 2001, 10:04 AM
#5
New Member
Originally posted by Kaverin
Even if the cache(s) in those OS's are user specified, there has to be some reference to them. Most likely there's a registry entry telling the system where the user specified the dir. I wish I could tell you where though. My use of the registry is very limited so far, but this could help you a little.
-
Apr 13th, 2001, 10:22 AM
#6
Use the following code to get the cache folder:
Code:
Private Declare Function SHGetSpecialFolderPath _
Lib "shell32.dll" Alias "SHGetSpecialFolderPathA" ( _
ByVal hwndOwner As Long, _
ByVal lpszPath As String, _
ByVal nFolder As Long, _
ByVal fCreate As Long) As Long
Private Const MAX_PATH As Long = 260
Private Const CSIDL_INTERNET_CACHE As Long = &H20
Public Function GetCacheFolder() As String
Dim sPath As String
sPath = Space$(MAX_PATH)
SHGetSpecialFolderPath 0, sPath, CSIDL_INTERNET_CACHE, 0
sPath = Left$(sPath, InStr(sPath, vbNullChar) - 1)
GetCacheFolder = sPath
End Function
Best regards
-
Jul 18th, 2001, 04:37 PM
#7
Fanatic Member
 Looking for a friendly intelligent chat forum? Visit the white-hart.net 
-
Jul 18th, 2001, 06:26 PM
#8
Fanatic Member
You all realize this post was dug up after 6 months, right?
I'm baaaack...
VB5 Professional Edition, VC++ 6
Using a 1 gHz Thunderbird, 256 mb RAM, 40 gb HD system with Win98se
I feel special because I finally figured out how to loop midis: Post link
I'm a fanatic too 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|