Tjalve Posted September 25, 2013 Share Posted September 25, 2013 Hello. Ive created a script that basicly connects to an FTP server, lists all the files nto an array and then loop through the files and download some of them (based on filetype in this case). Everything works good on my local Win7 machine. But when i run it on our WIndows 2008 R2 server, i cant get _FTP_ListToArray to work. The function is supposed to return an array. If there are no files, it still returns an rray but with the first element = 0. In this case. It only returns the value "0". The consolewrites in the script is for debuging. Is there any diffrence in the behavior of _FTP_ListToArray on Windoes server and Win7? Here is part that gives me issues $Open = _FTP_Open('FTPJUNK') $Conn = _FTP_Connect($Open, "ftpserver.se","username","password") ConsoleWrite(_FTP_DirSetCurrent($Conn, "public_html") & @CRLF) ConsoleWrite(_FTP_DirSetCurrent($Conn, "Uploads") & @CRLF) $ftp_files = _FTP_ListToArray($Conn, 2) _arraydisplay($ftp_files) ConsoleWrite($ftp_files & @CRLF) I should get an array with files. I just get 0. The _FTP_DirSetCurrent part works good and there are files on the FTP server. Any help is appritiated. /G Link to comment Share on other sites More sharing options...
Tjalve Posted September 26, 2013 Author Share Posted September 26, 2013 No one? Link to comment Share on other sites More sharing options...
water Posted September 26, 2013 Share Posted September 26, 2013 Please wait at least 24 hours before bumping a thread! My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
water Posted September 26, 2013 Share Posted September 26, 2013 BTW: Your script doesn't have any error checking at all! My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Tjalve Posted September 26, 2013 Author Share Posted September 26, 2013 I feel stupid... The problem was that the server needed to have a passive FTP connection. As soon as i switched to passive mode, everytjing works... Sorry to bother anyone It fooled me becuase the _FTP_DirSetCurrent returned 1 even if there was no connection at all... And the list function didnt return an error. Anyways. Sorry to bother you Link to comment Share on other sites More sharing options...
water Posted September 26, 2013 Share Posted September 26, 2013 No problem. Glad you could solve your problem My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki 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