BlackEvil Posted June 4, 2010 Posted June 4, 2010 I am doing a script for FTP to different IP's using AutoIT I may have multiple files and ofcource multiple IPS I have done this script and it always fails to put file into the second IP. Where I am wrong? Func TransferFile() GetGuiData() $Open = _FTP_Open('MyFTP') For $Idx = 0 To $ipCount - 1 Local $server = $IPlist[$Idx] $Conn = _FTP_Connect($Open, $server, $UserName, $Password, 1) ConsoleWrite("Total Files - " & $FileCount & @CRLF) If Not @error Then ConsoleWrite("Current IP is - " & $server & @CRLF) For $Idy = 0 To $FileCount - 1 ConsoleWrite("Current Source file is - " & $SourceFile[$Idy] & @CRLF) _FTP_FileDelete($Conn, $DestinationPath & $SourceFile[$Idy]) $Ftpp = _FTP_FilePut($Conn, $SourcePath[$Idy], $DestinationPath & $SourceFile[$Idy]) $percent = _FTP_ProgressUpload($Conn, $SourcePath[$Idy], $DestinationPath) ConsoleWrite('$Ftpp = ' & $Ftpp & @CRLF) If Not $Ftpp Then ConsoleWrite("Failed to upload " & $SourcePath & " at \\" & $server & @CRLF) MsgBox(0, "Error", "Failed to upload " & $SourcePath & " at \\" & $server) $Ftpc = _FTP_Close($Open) ConsoleWrite("_FTP_Close" & @CRLF) ExitLoop EndIf Next $Ftpc = _FTP_Close($Open) if $Ftpc Then ConsoleWrite("Close current FTP @ - " & $IPlist[$Idx] & @CRLF) Else MsgBox(0, "Error", "Connection Error at \\" & $server) $Ftpc = _FTP_Close($Open) ContinueLoop EndIf Next EndFunc ;==>TransferFile
Zibit Posted June 4, 2010 Posted June 4, 2010 reading the IP list right ? Creator Of Xtreme DevelopersPixel Pattern UDFTray GUI UDFMathssend & recive register scriptMouse Control via Webcam
BlackEvil Posted June 4, 2010 Author Posted June 4, 2010 reading the IP list right ? yes pops up the message for seccond ip here MsgBox(0, "Error", "Failed to upload " & $SourcePath & " at \\" & $server)
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