Hospital Posted July 29, 2015 Share Posted July 29, 2015 (edited) Hi guys, the script does upload the text file, but it will not read it in msgbox? I don't see why, and I've been trying... any idea why? #RequireAdmin #include <FTP.au3> #include <FTPEx.au3> $server = "ftp.stole--private" $username = "--private" $pass = "--private" $Open = _FTPOpen("--private") consolewrite( "Open: " & $Open & @crlf ) $Conn = _FTPConnect($Open, $server, $username, $pass) consolewrite( "Connect: " & $Conn & @crlf ) ;we are connected. $Ftpp = _FtpPutFile($Conn, @ScriptDir&"\TotalPurchases.txt", "TotalPurchases.txt") consolewrite( "Put Result: " & $Ftpp & @crlf ) ; reading it (this is where it stops working and returns blank.) $ftpfileopen = _FTP_FileOpen($Conn,"\TotalPurchases.txt") Local $ftpfile = _FTP_FileRead($ftpfileopen,100000) Global $convertstring = BinaryToString($ftpfile) msgbox(1,"read",$convertstring) $Ftpc = _FTPClose($Open) Edited July 29, 2015 by Hospital Link to comment Share on other sites More sharing options...
PACaleala Posted July 31, 2015 Share Posted July 31, 2015 Check what is in $Conn (line 19 ). Link to comment Share on other sites More sharing options...
Hospital Posted August 2, 2015 Author Share Posted August 2, 2015 I don't see what's wrong with it.I can do FilePut with $conn but I can't FileRead? Link to comment Share on other sites More sharing options...
kaisies Posted August 2, 2015 Share Posted August 2, 2015 (edited) Add error checking for_ftp_fileopen. Clearly it's failing. Editor or _ftp_fileread Edited August 2, 2015 by kaisies Link to comment Share on other sites More sharing options...
PACaleala Posted August 3, 2015 Share Posted August 3, 2015 What did you do to "see what's wrong with it" ? Link to comment Share on other sites More sharing options...
Hospital Posted August 3, 2015 Author Share Posted August 3, 2015 so, this a udf problem? Link to comment Share on other sites More sharing options...
PACaleala Posted August 5, 2015 Share Posted August 5, 2015 Read the AutoIt Help file andyou should learn that the functions _FTPConnect and _FTP_FileOpen return handles meaning two different things:If you still want to make it work you will have to modify your udf. Link to comment Share on other sites More sharing options...
AutoBert Posted August 5, 2015 Share Posted August 5, 2015 This works for me:#include <FTPEx.au3> $server = "127.0.0.1" $username = "Bert" $pass = "Test" $Open = _FTP_Open("--private") consolewrite( "Open: " & $Open & @crlf ) $Conn = _FTP_Connect($Open, $server, $username, $pass) consolewrite( "Connect: " & $Conn & @crlf ) ;we are connected. $Ftpp = _FTP_FilePut($Conn, @ScriptDir&"\FTP_FileRead.au3", "FTP_FileRead.au3") consolewrite( "Put Result: " & $Ftpp & @crlf ) ; reading it(this is where it stops working and returns blank.) $ftpfileopen = _FTP_FileOpen($Conn,"\FTP_FileRead.au3") Local $ftpfile = _FTP_FileRead($ftpfileopen,100000) Global $convertstring = BinaryToString($ftpfile) msgbox(1,"read",$convertstring) _FTP_Close($Conn) _FTP_Close($Open) 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