-
URLDownloadToFile
I've been using the URLDownloadToFile API call and I've been experiencing some hit & miss results that I've tracked down to the following. All of these examples return 0 (meaning successful download).
These two create the website.html file, as they should:
URLDownloadToFile(0, "http://www.google.com", "c:\website.html", 0, 0)
URLDownloadToFile(0, "http://www.microsoft.com", "c:\website.html", 0, 0)
But these don't create any file:
URLDownloadToFile(0, "http://www.msn.com", "c:\website.html", 0, 0)
URLDownloadToFile(0, "http://www.toysrus.com", "c:\website.html", 0, 0)
I've tried using the DeleteUrlCacheEntry function as well. Same result. The above are obviously just 4 examples. Some sites work, some don't. Why?
-
Re: URLDownloadToFile
Hmm, Interesting i;ve just developed a application at work to automate some tasks and have never experianced any problems.
I assume the reason for the issues is because you are specifying a site rather than a file? so maybe find out what the index file is and then downloading accordingly.
eg http://www.microsoft.com/index.htm (or whatever it is!)
-
Re: URLDownloadToFile
I tried, but not sure how to tell what the filename of the page is i'm looking for. Can you try to reduplicate this problem to make sure it's not just me?
-
Re: URLDownloadToFile
Give me 5 minutes I'll try it out.
-
Re: URLDownloadToFile
Ok i get the same thing as stated. It ahs to be to do with the actual site... let me see.