Sign in to follow this  
Followers 0
Akshay07

InetGet does not always force a reload from the remote site

10 posts in this topic

#1 ·  Posted (edited)

Hi all,

I have noticed something which seems to be random, Although I do set the InetGet function to force a reload from the remote site, it is not always doing it. Sometimes, the download stops (and is completed) before the time it should take to complete the full download.

To make sure that this statement is correct, I have used a mobile phone forced in 2G mode as a modem and downloaded a 100MB file. This should take ages to complete. But once in a while, after a few minutes, the download stops, the progress bar (autoit home made) shows "download completed" before the bar is "full" and I can see that I do have the 100MB file saved, with the correct file size.

Once again, it is very random and it is not easy to reproduce.

I am using this:

InetGet("http://www.mywebsite.com/100MBfile, "C:\MyFolder\100MBfile", 1, 1)

Any idea about what is wrong?

My understanding of "Forces a reload from the remote site." is that it should ignore if the file is available in the cache.

Thanks

Edited by Akshay07

Share this post


Link to post
Share on other sites



I had a similar issue when using my iphone as modem, i ignored it and figured it was the NAT settings by the ISP or something.


They call me MrRegExpMan

Share this post


Link to post
Share on other sites

Thanks.

But I never see this issue if I do the download manually after clearing the cache.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Am I the only having this issue?

Here is the script:

#include <ProgressConstants.au3>
#NoTrayIcon


$sFileToDownload = "abcd.zip"
$sDownloadPath = "http://MyWebSite/" & $sFileToDownload

$totalSize = InetGetSize($sDownloadPath)

$hFileDownloaded = InetGet($sDownloadPath, "C:\MyFolder\" & $sFileToDownload, 1, 1)
ProgressOn("Download progress", "Downloading " & $sFileToDownload, "0 %")

For $i = 0 to $totalSize step 1
    $aDownloadInfo = InetGetInfo( $hFileDownloaded)
    If $aDownloadInfo[2] = True Then ExitLoop
    $percentDownloaded = Round($aDownloadInfo[0]*100/$totalSize, 2)
    ProgressSet( $percentDownloaded, $percentDownloaded & " %")
    sleep(2000)
Next

ProgressSet(100 , "100%", "Download completed.")
sleep(5000)
ProgressOff()

Exit
Edited by Akshay07

Share this post


Link to post
Share on other sites

Might be worth putting in a bug report if you can't find the answer and it still fails to download the file correctly.

Share this post


Link to post
Share on other sites

What happens when you change this line?

$hFileDownloaded = InetGet($sDownloadPath, "C:\MyFolder\" & $sFileToDownload, 1, 1)

to

$hFileDownloaded = InetGet($sDownloadPath, "C:\MyFolder\" & $sFileToDownload, 9, 1)

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Thanks for your answer. As mentioned, this error is not easy to reproduce so I unfortunately cannot just retest this.

But isn't the value 8 (+1) for FTP only? My DL is a HTTP DL.

Edited by Akshay07

Share this post


Link to post
Share on other sites

Might be worth putting in a bug report if you can't find the answer and it still fails to download the file correctly.

Up :mellow:

I don't want to fill a bug report yet, unless I am sure that I am not doing anything wrong.

Share this post


Link to post
Share on other sites

Not probs. Just a thought, is it possible that a proxy is interfering with it? Might be worth checking to see if HttpSetProxy (1) command has any effect.

Share this post


Link to post
Share on other sites

Not probs. Just a thought, is it possible that a proxy is interfering with it? Might be worth checking to see if HttpSetProxy (1) command has any effect.

No proxy is used.

How do I open a bug report?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0