News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

URLDownloadToFile

Started by Arroso, May 02, 2006, 02:47:51 PM

Previous topic - Next topic

Arroso

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


zcoder

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....
Back in 1979, My computer ran so fine.
And there was no such thing,
As a Microsoft Crashed Machine.
http://zcoder.110mb.com
http://www.dietzel.com/partner/idevaffiliate.php?id=345_6  Free Domain Names

Arroso

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

   

PBrennick

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
The GeneSys Project is available from:
The Repository or My crappy website

PBrennick

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
The GeneSys Project is available from:
The Repository or My crappy website

Arroso

thank you very much Paul