ALW Posted June 1, 2011 Share Posted June 1, 2011 Good Day - I am very new to AutoIt - have gotten through a few scripts already and have decided to progress to the next level... FTP. Below is a script I wrote - gets to line 25 - the MsgBox with the "A","Upload..." and the error message is the box is -1 and the extended is 12018. My questions are: where/how does one easily decipher these message numbers and does anyone have ideas why I am getting these error messages? Unfortunately I cannot post the server/un/password due to security reasons - but have tried these server/un/pw settings in FileZilla and they work. Any ideas would be GREATLY appreciated.... #Include <FTPEx.au3> dim $CVSFileChannel dim $CVSOpenStatus dim $CVSPutStatus dim $CVSCloseStatus dim $FTPServer dim $FTPUsername dim $FTPPassword $CVSFTPServer = "xxxxx" $CVSFTPUsername = "xxxxx" $CVSFTPPassword = "xxxxx" $CVSFileChannel = _FTP_Open("MyChannel") if ($CVSFileChannel <> 0) Then $CVSOpenStatus = _FTP_Connect($CVSFileChannel,$CVSCodeStreetFTPServer,$CVSFTPUsername,$CVSFTPPassword,1,21) if ($CVSOpenStatus <> 0) Then $CVSPutStatus = _FTP_FilePut($CVSFileChannel, 'd:\garbage\ALWTest.csv','ALWTEST.TXT',$FTP_TRANSFER_TYPE_ASCII ) if ($CVSPutStatus = 1) Then MsgBox(4096,"OONE!","Done") Else Msgbox(4096,"A","Upload: " & @error & " " & @extended & @CRLF) Endif Else Msgbox(4096,"Error-B",@Error) EndIf Else Msgbox(4096,"Error-c",@Error) EndIf $CVSCloseStatus = _FTP_Close($l_InternetSession) Link to comment Share on other sites More sharing options...
hannes08 Posted June 1, 2011 Share Posted June 1, 2011 Hi ALW, there is an error in your syntax regarding the id .. else .. endif. Apart from that I don't see any error. Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler] Link to comment Share on other sites More sharing options...
Casey Posted June 1, 2011 Share Posted June 1, 2011 (edited) My questions are: where/how does one easily decipher these message numbersIn the help file there is a link to MSDN on the _FTP_FilePut page. From there follow the link to "FtpPutFile Function (Windows)". Then the "GetLastError" link. Then "System Error Codes". Then the link to the range your error message falls within. Then choose the "Internet Error Codes" link. Do a find for your error.If this is right your error is: The request to connect and log on to an FTP server could not be completed because the supplied password is incorrect.$CVSCloseStatus = _FTP_Close($l_InternetSession)Is this your production code? Why not _FTP_Close($CVSFileChannel)Also, you are declaring $CVSFTPServer and your connect statement is using $CVSCodeStreetFTPServer. If this is truely how your testing it then I would guess your problem lies here. Edited June 1, 2011 by Casey Link to comment Share on other sites More sharing options...
ALW Posted June 1, 2011 Author Share Posted June 1, 2011 I changed the code to remove all the IF's and got to the basics so I think ... Sill get a return status of 0 (error), a @error of -1 and extended of 12018.... is there a transalation of these messages? or other ideas? Thank you very much Tx. Include <FTPEx.au3> dim $CVSFileChannel dim $CVSOpenStatus dim $CVSPutStatus dim $CVSCloseStatus dim $CVSFTPServer dim $CVSFTPUsername dim $CVSFTPPassword $CVSFTPServer = 'xxxxx' $CVSFTPUsername = 'xxxxx' $CVSFTPPassword = 'xxxxx' $CVSFileChannel = _FTP_Open('MYChannel') $CVSOpenStatus = _FTP_Connect($CVSFileChannel,$CVSFTPServer,$CVSFTPUsername,$CVSFTPPassword,1,21) $CVSPutStatus = _FTP_FilePut($CVSFileChannel, 'd:\garbage\ALWTest.csv','ALWTEST.TXT',$FTP_TRANSFER_TYPE_ASCII ) msgbox(4096,"Status",$CVSPutStatus&' ** '&@error& ' ** ' & @extended ) $CVSCloseStatus = _FTP_Close($CVSFileChannel) Link to comment Share on other sites More sharing options...
ALW Posted June 1, 2011 Author Share Posted June 1, 2011 In the help file there is a link to MSDN on the _FTP_FilePut page. From there follow the link to "FtpPutFile Function (Windows)". Then the "GetLastError" link. Then "System Error Codes". Then the link to the range your error message falls within. Then choose the "Internet Error Codes" link. Do a find for your error.If this is right your error is: The request to connect and log on to an FTP server could not be completed because the supplied password is incorrect.tx - will have to check again and appreciate the deciphering of the error.... probably an error right bfore my eyes. Link to comment Share on other sites More sharing options...
Casey Posted June 1, 2011 Share Posted June 1, 2011 (edited) $CVSPutStatus = _FTP_FilePut($CVSFileChannelI think your looking for a begining like $CVSPutStatus = _FTP_FilePut($CVSOpenStatus Edited June 1, 2011 by Casey Link to comment Share on other sites More sharing options...
ALW Posted June 1, 2011 Author Share Posted June 1, 2011 I think your looking for a begining like $CVSPutStatus = _FTP_FilePut($CVSOpenStatusThat was it THANK YOU!!!!!!!!!! Link to comment Share on other sites More sharing options...
Casey Posted June 1, 2011 Share Posted June 1, 2011 That was it THANK YOU!!!!!!!!!!Yep, glad to help.Casey 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