Jump to content
Sign in to follow this  
elfangor

InetGet error 31

Recommended Posts

elfangor

Hi!

I just need to make an AutoIt script to get a file on the web. I find this script on the example

MsgBox(0,"Telechargement", "Telechargement du client en cours" & @TempDir)
DirCreate ( @TempDir & "\ test \")
Local $hDownload = InetGet("http://www.autoitscript.com/autoit3/files/beta/update.dat", @TempDir & "\ test \", 1, 1)
Do
    Sleep(250)
Until InetGetInfo($hDownload, 2)    ; Check if the download is complete.
Local $aData = InetGetInfo($hDownload)  ; Get all information.
InetClose($hDownload)   ; Close the handle to release resourcs.
MsgBox(0, "", "Bytes read: " & $aData[0] & @CRLF & _
    "Size: " & $aData[1] & @CRLF & _
    "Complete?: " & $aData[2] & @CRLF & _
    "Successful?: " & $aData[3] & @CRLF & _
    "@error: " & $aData[4] & @CRLF & _
    "@extended: " & $aData[5] & @CRLF)

I did some modification, but even without it it doesn't work. When you go on Autoit You can see the file.

Error i got:

Bytes Read:0
Size: 445
Complete: True
Successfull: False
@error: 31
@extend: 123

I can't find something about error 31 with inetGet except this Autoit.de but that doesn't help me.

I have AutoIt v3.3.6.1

Thanks for your time

Elfangor

P.S: Sorry for my bad English

Share this post


Link to post
Share on other sites
ripdad

Tested. Try this:

MsgBox(0, "Telechargement", "Telechargement du client en cours" & @TempDir)
DirCreate(@TempDir & "\test")
Local $hDownload = InetGet("http://www.autoitscript.com/autoit3/files/beta/update.dat", @TempDir & "\test\update.dat", 1, 1)
Do
    Sleep(250)
Until InetGetInfo($hDownload, 2) ; Check if the download is complete.
Local $aData = InetGetInfo($hDownload) ; Get all information.
InetClose($hDownload) ; Close the handle to release resourcs.
MsgBox(0, "", "Bytes read: " & $aData[0] & @CRLF & _
        "Size: " & $aData[1] & @CRLF & _
        "Complete?: " & $aData[2] & @CRLF & _
        "Successful?: " & $aData[3] & @CRLF & _
        "@error: " & $aData[4] & @CRLF & _
        "@extended: " & $aData[5] & @CRLF)

"The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward

Share this post


Link to post
Share on other sites
tip

Hi,

I know this is an old thread but I recently have encountered the same issue. I wanted to share what I've learned for the troublesomes of the future :huh2:...

I think the "error 31" is "Inetget can't write to the specified file path" error ;). It can happen if destination folder doesn't exist, destination file is write protected or currently open etc. At least it was in my case :alien:

Regards

Tip


[center]MsgBox_Tipped: Eye candy msgboxes/inputboxes/loginboxes. | CreateBlankBox: Semi-transparent layers with borders and rounded corners.[/center]

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  

×