elfangor Posted August 17, 2010 Share Posted August 17, 2010 Hi!I just need to make an AutoIt script to get a file on the web. I find this script on the exampleMsgBox(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: 123I 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.1Thanks for your timeElfangorP.S: Sorry for my bad English Link to comment Share on other sites More sharing options...
ripdad Posted August 17, 2010 Share Posted August 17, 2010 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 Link to comment Share on other sites More sharing options...
tip Posted June 13, 2011 Share Posted June 13, 2011 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 ... 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 Regards Tip [center]MsgBox_Tipped: Eye candy msgboxes/inputboxes/loginboxes. | CreateBlankBox: Semi-transparent layers with borders and rounded corners.[/center] Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now