Sign in to follow this  
Followers 0
Altor

Problem with _FTP_Command

4 posts in this topic

Hi:

I have a little problem with this command.
I have a FTP server with a root directory and a FILES directory and i want a list of files into the FILES directory.
The script work well for a root directory but when i wont to force to go to FILES directory whith the _FTP_Command this no change the directory and the function return 0.
I would be very grateful if someone could give me some solution.
Thank's
Altor

#include <FTPEx.au3>
  #include <Array.au3>

Local $server = ""
Local $usuari = ""
Local $password =""

Local $Open = _FTP_Open("My connection") 
Local $Conn = _FTP_Connect($Open, $server, $usuari, $password,0)

$FTP_dir =_FTP_Command($Conn,"cd FILES")

Local $aFile = _FTP_ListToArray($Conn, 0) 

_ArrayDisplay($aFile, "Dir")

Local $iFtpc = _FTP_Close($Conn)
Local $iFtpo = _FTP_Close($Open)

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

So the dir structure is definitely Server Root -> FILES -> listed files ?

EDIT: Also, welcome to the AutoIt forum! :D

Edited by MikahS

Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

Share this post


Link to post
Share on other sites

Ok Breathe, thank you very much for your reply.
The server root directory have same files and folders and the script work fine working in a root server directory.
If i execute a cmd ftp client of windows work well.
ftp .........
user .......
pass.......
ls
cd FILES
ls

For security disable windows firewall for if the active or passive mode were the problem.

I don't know if i apply well the _FTP_Command for change the directory or i need other command for it

Thank's

Share this post


Link to post
Share on other sites

Hi

Problem solved.

I need to use a raw FTP commands

_FTP_Command($Conn,"CWD FILES")    is the right code

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  
Followers 0