Jump to content

Problem with _FTP_ListToArray on Windows server 2008 R2


Recommended Posts

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 post
Share on other sites

Please wait at least 24 hours before bumping a thread!

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2021-06-05 - Version 1.5.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (NEW 2021-06-14 - Version 1.6.5.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (NEW 2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to post
Share on other sites

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

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2021-06-05 - Version 1.5.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (NEW 2021-06-14 - Version 1.6.5.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (NEW 2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to post
Share on other sites

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

Link to post
Share on other sites

No problem. Glad you could solve your problem :)

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2021-06-05 - Version 1.5.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (NEW 2021-06-14 - Version 1.6.5.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (NEW 2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...