Jump to content

FTP Put Issue


Recommended Posts

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

My questions are: where/how does one easily decipher these message numbers

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.

$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 by Casey
Link to comment
Share on other sites

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

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

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
 Share

  • Recently Browsing   0 members

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