Page 1 of 2

Posted: Tue Sep 10, 2002 9:36 am
by BackupUser
Restored from previous forum. Originally posted by fweil.

When using URLDownloadToFile API function allows to cache a Web page in a local file for any further parsing or storage.

The problem is that the file is cached through the standard Internet layer of Windows and if the file was previously cached on the local machine it is not reloaded by the URLDownloadToFile function.

URLDownloadToFile_(0, YourURL, YourFile, 0, 0)
DeleteUrlCacheEntry_(YourURL)

is a simple way to force the cache to delete the page's image and to reload it the next time.

This is especially handy for regular pages checks (when accessing dynamic content for example) and make it an easier way rather than using InternetOpen_() InternetOpenFile_() and InterReadFile_() with specific flags for forcing page's reload.


Francois Weil
14, rue Douer
F64100 Bayonne

Posted: Tue Sep 10, 2002 11:42 am
by BackupUser
Restored from previous forum. Originally posted by PB.

> DeleteUrlCacheEntry_(YourURL) is a simple way to force the cache to
> delete the page's image and to reload it the next time.

Thanks for that, Francois; I've added it to my apps. :)


PB - Registered PureBasic Coder

Posted: Tue Sep 10, 2002 12:15 pm
by BackupUser
Restored from previous forum. Originally posted by tranquil.

Thanks Fweil a lot, couse I want to use URLDownloadToFile to download actual serverlists for our sharing-tool. Would be silly to download cached - old - serverlists with dead servers.

But you prevent this problem. :) hehe

Thanks
Mike

Tranquilizer/ Secretly!
http://www.secretly.de
Registred PureBasic User

Posted: Tue Sep 10, 2002 2:46 pm
by BackupUser
Restored from previous forum. Originally posted by fweil.

...

All this API Internet stuff is tricky but while searching we can find some good and short ways to solve our issues !!! (:>)

Francois Weil
14, rue Douer
F64100 Bayonne

Posted: Tue Sep 10, 2002 3:09 pm
by BackupUser
Restored from previous forum. Originally posted by PB.

IMPORTANT TIP FOR THIS API COMMAND!

The URLDownloadToFile API command is extremely useful, but I just want
to ensure that you all remember this very important tip: Make sure that
your app makes it clear in its docs that it doesn't contain "spyware"
of any kind! Using this API command will set off warning bells in many
firewall apps (such as ZoneAlarm) and the last thing you want to do is
scare off new users of your app who think it's trying to spy on them,
or "phone home", as they say. So make sure you put their concerns to
rest in your docs, and explain why your app is accessing the Internet
before it does so. Trust me on this -- I went through it. :)


PB - Registered PureBasic Coder

Posted: Tue Sep 10, 2002 3:22 pm
by BackupUser
Restored from previous forum. Originally posted by fweil.

You are right PB. I always give a networking security notice to customers anyway, even without this specific function. As soon as you use MS stuff, think to give an explicit notice relating too security issues.

Francois Weil
14, rue Douer
F64100 Bayonne

Posted: Wed Oct 23, 2002 7:16 pm
by BackupUser
Restored from previous forum. Originally posted by PB.

One thing I just learnt about this tip: The DeleteUrlCacheEntry API
is not available under Windows 95, and will crash your app if you try
to use it on that OS...


PB - Registered PureBasic Coder

Posted: Thu Oct 24, 2002 5:58 am
by BackupUser
Restored from previous forum. Originally posted by fweil.

Sorry that I could not check about all OS versions compatibility. By the way I always use 2K, sometime NT4 or 98 ... for my coding and tests.

Francois Weil
14, rue Douer
F64100 Bayonne

Posted: Thu Oct 24, 2002 10:58 am
by BackupUser
Restored from previous forum. Originally posted by PB.

> Sorry that I could not check about all OS versions compatibility.

No need to apologize; I was just letting people know.


PB - Registered PureBasic Coder

Posted: Sat Nov 16, 2002 9:54 pm
by BackupUser
Restored from previous forum. Originally posted by danny.


I have a problem with DeleteUrlCacheEntry on some XP systems.
I haven't encountered it myself, but the problem seems to occur every once in a while on a client XP machine: I call DeleteUrlCacheEntry prior to calling URLDownloadToFile, in order to ensure that the file will NOT be downloaded from the cache - however sometimes, on XP, it nevertheless comes from the cache, and the user gets an older version than the one on the server.

Any idea?

Thanks!

Posted: Sun Nov 17, 2002 7:44 am
by BackupUser
Restored from previous forum. Originally posted by PB.

> I call DeleteUrlCacheEntry prior to calling URLDownloadToFile

I think you have to call it after, not before, but I haven't tested
this to be 100% sure. Give it a try and let us know what happens.


PB - Registered PureBasic Coder

Posted: Wed Jul 28, 2004 8:36 pm
by berklee
It'd sure be nice to have a cross-platform means of using TCP/IP. I'm surprised it's not in place already, especially considering that ODBC is.

Posted: Wed Jul 28, 2004 10:54 pm
by blueznl
berklee: winsock?

Posted: Thu Jul 29, 2004 10:20 am
by berklee
Anything. I have an app I have to write that requires cross-platform functionality (think of it as an RSS reader). But the problem seems to be that if I want to download a file from the internet, the mechanics need to be completely different for each OS.

It would be real nice to have some sort of wrapper to handle simple HTTP POST/GET transactions... I'm sure I can figure it out under Windows, but I'd hate to suffer a massive code rewrite to put it under Linux...

I guess this means I'm looking for a cross-platform TCP/IP gadget...

Posted: Thu Jul 29, 2004 11:58 am
by Num3
@berklee

I supose this is what you are looking for ;)

viewtopic.php?t=11095