Jump to content

InetGet does not always force a reload from the remote site


Akshay07
 Share

Recommended Posts

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
Link to comment
Share on other sites

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
Link to comment
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!"

Link to comment
Share on other sites

  • 3 weeks later...

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...