Sign in to follow this  
Followers 0
jdefockert

InetGet only downloads part of the file and results in @error=0

4 posts in this topic

Hi all,

I am trying to write a script that downloads a zip file and it used to work in the past, but now trying to download the zip file from the website with INETGET only results in a partially downloaded file and an @error = 0.

If I paste the same URL in my browser (Firefox and Internet Explorer) the file downloads without a problem.

But if I try to download the file with InetGet then that results in an @error =0.

If I try to download a file from another website I have no problems.

Any idea what could cause this?

Thanks in advance or your reply!

Jasper de Fockert

----code----------

; Download the ZIP file

InetGet ('http://bbclone.de/dist/bbclone-latest.zip','c:\bbtemp\bbclone.zip',1,0)

;Sleep(2000)

If @error = 0 Then

MsgBox(0,'Error','File from BBClone website was not properly dowloaded. Please try again')

Exit

EndIf

Share this post


Link to post
Share on other sites



dont know... even the get size errors to 0

$size = InetGetSize("http://bbclone.de/dist/bbclone-latest.zip")
MsgBox(0, "Size of remote file:", $size)



InetGet ("http://bbclone.de/dist/bbclone-latest.zip","c:\temp\bbclone.zip",1,1)

While @InetGetActive
  TrayTip("Downloading", "Bytes = " & @InetGetBytesRead, 10, 16)
  Sleep(250)
Wend

MsgBox(0, "Bytes read", "Read " & @InetGetBytesRead & @CRLF & " Error level " & @error)

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

dont know... even the get size errors to 0

$size = InetGetSize("http://bbclone.de/dist/bbclone-latest.zip")
MsgBox(0, "Size of remote file:", $size)
InetGet ("http://bbclone.de/dist/bbclone-latest.zip","c:\temp\bbclone.zip",1,1)

While @InetGetActive
  TrayTip("Downloading", "Bytes = " & @InetGetBytesRead, 10, 16)
  Sleep(250)
Wend

MsgBox(0, "Bytes read", "Read " & @InetGetBytesRead & @CRLF & " Error level " & @error)

8)

I get 0 when trying the InetGetSize example direct from the help file.


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

...If @error = 0 Then...

As best I can tell, @error is not set by InetGet.

Not that this really helps, but you can run this code:

$size1 = InetGetSize('http://bbclone.de/dist/bbclone-latest.zip')
MsgBox(0, "InetGetSize Failure: Returns 0 and sets @error to 1.",_
          "$size1 = " & $size1 & @CRLF & _
          "@error = " & @error)

$InetGet_Return1 = InetGet('http://bbclone.de/dist/bbclone-latest.zip', 'c:\temp\bbclone.zip', 1, 0)
MsgBox(0, "InetGet Failure: Returns 0. ",_
          "$size1 = " & $size1 & @CRLF & _
          "$InetGet_Return1 = " & $InetGet_Return1 & @CRLF & _
          "@error is not set.")

$size2 = InetGetSize('http://free.grisoft.com/softw/70free/update/u7iavi156n9.bin')
MsgBox(0, "InetGetSize Failure: Returns 0 and sets @error to 1.",_
          "$size2 = " & $size2 & @CRLF & _
          "@error = " & @error)

$InetGet_Return2 = InetGet('http://free.grisoft.com/softw/70free/update/u7iavi156n9.bin', 'c:\temp\u7iavi156n9.bin', 1, 0)
MsgBox(0, "InetGet Failure: Returns 0. ",_
          "From the first download" & @CRLF & _
          "$size1 = " & $size1 & @CRLF & _
          "$InetGet_Return1 = " & $InetGet_Return1 & @CRLF & @CRLF & _
          "From the second download" & @CRLF & _
          "$size2 = " & $size2 & @CRLF & _
          "$InetGet_Return2 = " & $InetGet_Return2 & @CRLF & _
          "@error is not set.")

[size="1"][font="Arial"].[u].[/u][/font][/size]

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