Jump to content

Recommended Posts

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
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
Posted

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!"

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
Posted

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.

  • 3 weeks later...
Posted

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?

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
  • Recently Browsing   0 members

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