It is currently Fri Aug 23, 2019 2:54 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next
Author Message
 Post subject:
PostPosted: Tue Sep 10, 2002 9:36 am 
Offline
PureBasic Guru
PureBasic Guru

Joined: Tue Apr 22, 2003 7:42 pm
Posts: 16777133
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


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Sep 10, 2002 11:42 am 
Offline
PureBasic Guru
PureBasic Guru

Joined: Tue Apr 22, 2003 7:42 pm
Posts: 16777133
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


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Sep 10, 2002 12:15 pm 
Offline
PureBasic Guru
PureBasic Guru

Joined: Tue Apr 22, 2003 7:42 pm
Posts: 16777133
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


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Sep 10, 2002 2:46 pm 
Offline
PureBasic Guru
PureBasic Guru

Joined: Tue Apr 22, 2003 7:42 pm
Posts: 16777133
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


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Sep 10, 2002 3:09 pm 
Offline
PureBasic Guru
PureBasic Guru

Joined: Tue Apr 22, 2003 7:42 pm
Posts: 16777133
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


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Sep 10, 2002 3:22 pm 
Offline
PureBasic Guru
PureBasic Guru

Joined: Tue Apr 22, 2003 7:42 pm
Posts: 16777133
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


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Oct 23, 2002 7:16 pm 
Offline
PureBasic Guru
PureBasic Guru

Joined: Tue Apr 22, 2003 7:42 pm
Posts: 16777133
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


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Oct 24, 2002 5:58 am 
Offline
PureBasic Guru
PureBasic Guru

Joined: Tue Apr 22, 2003 7:42 pm
Posts: 16777133
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


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Oct 24, 2002 10:58 am 
Offline
PureBasic Guru
PureBasic Guru

Joined: Tue Apr 22, 2003 7:42 pm
Posts: 16777133
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


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Nov 16, 2002 9:54 pm 
Offline
PureBasic Guru
PureBasic Guru

Joined: Tue Apr 22, 2003 7:42 pm
Posts: 16777133
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!


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Nov 17, 2002 7:44 am 
Offline
PureBasic Guru
PureBasic Guru

Joined: Tue Apr 22, 2003 7:42 pm
Posts: 16777133
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


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Jul 28, 2004 8:36 pm 
Offline
User
User

Joined: Wed Jul 28, 2004 3:45 pm
Posts: 36
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.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Jul 28, 2004 10:54 pm 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat May 17, 2003 11:31 am
Posts: 6061
berklee: winsock?

_________________
( PB5.xx Win10 x64 Asrock AB350 Pro4 Ryzen 1600X 32GB RAM Evo 840 GTX1060 )
( The path to enlightenment and the PureBasic Survival Guide right here... )


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Jul 29, 2004 10:20 am 
Offline
User
User

Joined: Wed Jul 28, 2004 3:45 pm
Posts: 36
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...


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Jul 29, 2004 11:58 am 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Fri Apr 25, 2003 4:51 pm
Posts: 2808
Location: Portugal, Lisbon
@berklee

I supose this is what you are looking for ;)

http://forums.purebasic.com/english/vie ... hp?t=11095

_________________
Software: http://xipa.org
Elevator Maintenance: http://central-elevadores.pt
Good web hosting!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye