darkjohn20 Posted May 13, 2010 Share Posted May 13, 2010 (edited) Alright, so recently I've been working with FTP. Since I can't test my FTP scripts due to the fact that my server is on the same computer, I signed up for a free online FTP server (maytech.net). I've been able to successfully connect to my FTP Server, but when I try to list the files to an array, the return value isn't an array (meaning it failed). I'm not sure what's causing this problem... My script (trimmed quite a bit): #include <FTPEx.au3> #include <Array.au3> Global $ftpServer = "myselectedname.ftpstream.com" Global $ftpUsername = "" Global $ftpPassword = "" $ftpOpen = _FTP_Open("FTP Control") $ftpConnect = _FTP_Connect($ftpOpen, $ftpServer, $ftpUsername, $ftpPassword) $Remote_List = _Ftp_ListToArray($ftpConnect, 0) _FTP_GetLastResponseInfo($dwError, $szMessage) ConsoleWrite("Error: " & $dwError & @CRLF & "Message: " & $szMessage & @CRLF) _ArrayDisplay($Remote_List) _FTP_Close($ftpOpen) In the Console, the following is written: Error: 0 Message: 200 PORT command successful Side note: I can work with files and folders just fine with the FileZilla Client. I can download as well as upload just fine. Edited May 13, 2010 by darkjohn20 Link to comment Share on other sites More sharing options...
wolf9228 Posted May 13, 2010 Share Posted May 13, 2010 (edited) Alright, so recently I've been working with FTP. Since I can't test my FTP scripts due to the fact that my server is on the same computer, I signed up for a free online FTP server (maytech.net). I've been able to successfully connect to my FTP Server, but when I try to list the files to an array, the return value isn't an array (meaning it failed). I'm not sure what's causing this problem... My script (trimmed quite a bit): #include <FTPEx.au3> #include <Array.au3> Global $ftpServer = "myselectedname.ftpstream.com" Global $ftpUsername = "" Global $ftpPassword = "" $ftpOpen = _FTP_Open("FTP Control") $ftpConnect = _FTP_Connect($ftpOpen, $ftpServer, $ftpUsername, $ftpPassword) $Remote_List = _Ftp_ListToArray($ftpConnect, 0) _FTP_GetLastResponseInfo($dwError, $szMessage) ConsoleWrite("Error: " & $dwError & @CRLF & "Message: " & $szMessage & @CRLF) _ArrayDisplay($Remote_List) _FTP_Close($ftpOpen) In the Console, the following is written: Error: 0 Message: 200 PORT command successful Side note: I can work with files and folders just fine with the FileZilla Client. I can download as well as upload just fine. Maybe you should add PASSIVE FLAG ==> $i_Passive = 1 This code works successfully I tested #include <FTPEx.au3> #Include <Array.au3> $server = 'myselectedname.ftpstream.com' $username = '' $pass = '' Dim $dwError , $szMessage $Open = _FTP_Open('MyFTP Control') $Conn = _FTP_Connect($Open, $server, $username, $pass,1,21) _FTP_GetLastResponseInfo($dwError, $szMessage) ConsoleWrite("Error: " & $dwError & @CRLF & "Message: " & $szMessage & @CRLF) $aFile = _FTP_ListToArray($Conn, 2) _ArrayDisplay($aFile,"") $Ftpc = _FTP_Close($Open) Edited May 13, 2010 by wolf9228 صرح السماء كان هنا Link to comment Share on other sites More sharing options...
darkjohn20 Posted May 13, 2010 Author Share Posted May 13, 2010 Thanks. It worked perfectly. 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