Hi everybody,
I'm using the URLDownloadToFile function (urlmon.inc & .lib) almost successfully. I mean, I'm able to download a file.
Once the function has ended I always get a 0h into EAX. No matter the file was found or wasn't.
Do you guys know if there's anything else that could be tested?
thanks in advance
Arroso,
the MSDN says:
E_OUTOFMEMORY = The buffer length is invalid or there was insufficient memory to complete the operation.
S_OK = The operation succeeded.
But if it does like you say and only returns 0 for sucess or not, then you will have to
just check to see if the file exists or not to know if it was sucessfull or not.
I am not sure why it is not letting you know the results.
Zcoder....
thanks Zcoder, testing 4 file existence is what I'm actually doing, indeed.
a funny variation of the case is a site that once asked 4 a non-existing file they give you a default html page instead!
oh my... :8) it ends up scanning the "[ht" substring into the ready file too :eek
all an all, the W2K is alwayS fun
thanks again
Arroso
Quotea funny variation of the case is a site that once asked 4 a non-existing file they give you a default html page instead!
This is not a funny or unusual thing. It is done on purpose to prevent a certain type of access to your website. It closes a loophole, in other words. If an error of type 'file not found' occurs, a script is automatically run called .htaccess, mine contains the following line,
QuoteErrorDocument 404 /404.html
As you can see, if someone tries to break in that way, 404.html will run. To see mine in action, you will note that http://www.pbrennick.com/trash.can yields the same results as http://www.pbrennick.com/404.html
hth,
Paul
Arroso,
As far as the topic (URLDownloadToFile function) is concerned; Greg posted a utility that uses that function (correctly) to download a ZIP file from the web and unzip it into the director of your choosing. A powerful utility that can be found here,
http://www.masmforum.com/simple/index.php?topic=4687.msg35173#msg35173
Have fun,
Paul
thank you very much Paul