ReceiveHTTPFile() - please add flag for cache-using

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
gekkonier
User
User
Posts: 78
Joined: Mon Apr 23, 2007 9:42 am

ReceiveHTTPFile() - please add flag for cache-using

Post by gekkonier »

If I use the buildin ReceiveHTTPFile() in a loop to grab pictures from an ip-cam, ReceiveHTTPFile() will always use a cached image, until i restart the program. Using the ReceiveHTTPFile() in a dll with OpenLibrary AND CloseLibrary doesn't fix this.

If I want "no caching" I tend to make an own exe and drive it with arguments, but I think it could be better if there would be an optional flag for ReceiveHTTPFile(), that says caching or not.

I also tried to use the WinApi functions:

Code: Select all

DeleteUrlCacheEntry_(url)
URLDownloadToFile_(#Null, url, localfile, #Null, #Null)
Here is the same problem, mainly because my lack of winapi knowledge.

I know, I could use this here:
http://www.purebasic.fr/english/viewtop ... 199#217199

It would be nice to download without caching in ReceiveHTTPFile() - It could make things much more easier.
gekkonier
User
User
Posts: 78
Joined: Mon Apr 23, 2007 9:42 am

Post by gekkonier »

Okay, I found a workaround:

Basically this does what it does (without errorchecking, add it yourself 8) ):

Code: Select all

CacheFileName.s = Space(1024)
URLDownloadToCacheFile_(0,URL,CacheFileName,1024,0,0)
DeleteFile(CacheFileName)
Post Reply