5

Consider:

D:\Program Files\FileZilla FTP Client\filezilla.exe -c 0/GG/DG/ -a "K:\YY\XXXXX\AAAA\BB\idS.txt"

This code doesn't work as it says:

"PATH NOT FOUND" K:\YY\XXXXX\AAAA\BB\idS.txt

However

D:\Program Files\FileZilla FTP Client\filezilla.exe -c 0/GG/DG/ -a "K:\YY\XXXXX\AAAA\BB"

just connects to the FTP site I wished without any file being transferred.

Why is it not working?

1
  • 4
    Why you are using Filezilla for something like this? Just use WinSCP or even ftp client from Windows.
    – Kamil
    Nov 22, 2014 at 18:28

2 Answers 2

17

FileZilla does not have any command line arguments (nor any other way) that allow automatic transfer. See:
FileZilla Client command-line arguments
https://trac.filezilla-project.org/ticket/2317
How do I send a file with FileZilla from the command line?


Though you can use any other client that allows automation. You have not specified what protocol you are using, the FTP or the SFTP.

You will definitely be able to use WinSCP as it supports all protocols that FileZilla does (and more).

See https://winscp.net/eng/docs/guide_automation

Typical WinSCP script for upload looks like:

open sftp://user:[email protected]/ -hostkey="ssh-rsa 2048 xxxxxxxxxxx...="
put c:\mypdfs\*.pdf /home/user/
exit

To run the script use:

WinSCP.com /log=ftp.log /script=script.txt

This is for SFTP. If you are using FTP, just replace the sftp:// with the ftp:// and remove the -hostkey=...


The WinSCP can generate a script from an imported FileZilla session.

For details, see the guide to FileZilla automation.

(I'm the author of WinSCP)


Another option, if you are using SFTP, is psftp client:
https://the.earth.li/~sgtatham/putty/latest/htmldoc/Chapter6.html#psftp

0
0

-a tells the FileZilla client where local files work should be done. That is, it's where files should be downloaded to or uploaded from by default (if no specific paths are used in the transfer command itself).

It's expects a path to a folder.

From the FileZilla documentation:

-a, --local=

Sets the local site (left-hand side) to the given path.

Use double quotation for paths with spaces in them.

FileZilla isn't intended to be scripted (their goal is to be a GUI client), so there's no way to specify files to transfer from the commandline.

Perhaps look into using Windows' in-built FTP.exe for scripting.

From ftp /?:

Transfers files to and from a computer running an FTP server service
(sometimes called a daemon). Ftp can be used interactively.

FTP [-v] [-d] [-i] [-n] [-g] [-s:filename] [-a] [-A] [-x:sendbuffer] [-r:recvbuf
fer] [-b:asyncbuffers] [-w:windowsize] [host]

  -v              Suppresses display of remote server responses.
  -n              Suppresses auto-login upon initial connection.
  -i              Turns off interactive prompting during multiple file
                  transfers.
  -d              Enables debugging.
  -g              Disables filename globbing (see GLOB command).
  -s:filename     Specifies a text file containing FTP commands; the
                  commands will automatically run after FTP starts.
  -a              Use any local interface when binding data connection.
  -A              login as anonymous.
  -x:send sockbuf Overrides the default SO_SNDBUF size of 8192.
  -r:recv sockbuf Overrides the default SO_RCVBUF size of 8192.
  -b:async count  Overrides the default async count of 3
  -w:windowsize   Overrides the default transfer buffer size of 65535.
  host            Specifies the host name or IP address of the remote
                  host to connect to.

Notes:
  - mget and mput commands take y/n/q for yes/no/quit.
  - Use Control-C to abort commands.

Not the answer you're looking for? Browse other questions tagged .