Jump to content
Sign in to follow this  
Tjalve

Problem with _FTP_ListToArray on Windows server 2008 R2

Recommended Posts

Tjalve

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

Share this post


Link to post
Share on other sites
water

Please wait at least 24 hours before bumping a thread!


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
water

BTW: Your script doesn't have any error checking at all!


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
Tjalve

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 :P
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 :)

Share this post


Link to post
Share on other sites
water

No problem. Glad you could solve your problem :)


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
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
Sign in to follow this  

×