filezilla - Can I Upload One File To Multiple Domain Folders In FTP?

02
2013-08
  • John

    I want to upload(and eventually overwrite) the same index.php file to many domain folders. Is there anyway to do this in one go or a shortcut?

    I am using Filezilla.

    Thanks

    Edit:

    Since I am really a newbie on FTP commands, I managed to find an ftp program that help me achieved what I wanted. It's called PyroFTP. It had a sample script that I could follow, and eventually I ended up with something like this and simply executing it:

    Connect "ftp.site.com", "username", "password"
    
    LocalChDir "D:\folder"
    
    RemoteChDir "public_html/domainfolder1"
    Put "file.txt"
    
    RemoteChDir "../domainfolder2"
    Put "file.txt"
    
    RemoteChDir "../domainfolder3"
    Put "ifile.txt"
    
    Disconnect 
    
  • Answers
  • Bob

    Windows answer

    This is essentially providing a working script for music2myear's answer, but not for FileZilla.

    I used to do this using a batch script and a program called NcFTP - FileZilla likely did not support command line at the time since I was using it for everything else. It should be quite easy to modify for FileZilla, if you want.

    @FOR /F "eol=; tokens=1,2,3,4" %%A IN (ftpdetails.txt) DO call ncftpput -u %%A -p %%B %%C %%D %1
    @pause
    

    It would take destinations from a text file (ftpdetails.txt) with the following format:

    username password ip destinationfolder ; comment
    username2 password2 ip2 destinationfolder2 ; comment2
    

    This modified version would open every destination in parallel, but risks flooding:

    @FOR /F "eol=; tokens=1,2,3,4" %%A IN (ftpdetails.txt) DO start ncftpput -u %%A -p %%B %%C %%D %1
    @pause
    

    Usage was just dragging the file I wanted to upload on top of the batch file. %1 could be replaced with a filename to upload by opening it. As it is, spaces would break it.

  • music2myear
    filezilla.exe -u “c:\ftp\TestFile.txt” ftp://ftp_user:ftp_password@ftp_host_ip/folderpath -close
    

    Filezilla can be scripted. If you're using Windows, it's built-in FTP can also be scripted.

    Just put together a script that moves the file to all the desired hosts and run it when you update the index file.

    Scripting instructions

    When you want to automate tasks with programs that accept command line arguments, scripting is how you do it.

    You will need the following information:

    • The full path to the file you wish to upload.
    • The username, password, server IP address or domain name, and folder path to the files that need to be updated.

    The "Remote Site" is for if you've set up a connection profile for each server in FileZilla. You can call the connection profile by name and thus avoid having to enter the username, password, server, and path for each connection. Looking at the documentation though, I think entering the information is easier and more clear.

    In FileZilla, create a connection profile for each server you wish to upload the file to.

    Open Notepad. Enter the following text changed for your specific settings and needs. Save the file as (whatever name you want).bat.

    filezilla.exe -u "<full path to the file on your computer>" ftp://username:password@server/path -close
    

    Add as many copies of this line as you need: one for each of the files you're updating.

    Bob's answer shows how you can use loops and a source file to automate much of this process. It's a lot more difficult to understand the syntax of the loops, but his solution does the same thing and may be easier to manage if you have to update a large number of servers.


  • Related Question

    ftp - How can I get FileZilla to ignore folder or files (like .svn or CVS)?
  • Michael Paulukonis

    How can I get FileZille to ignore folders or files? I don't want to upload my version-control info to my web-server!

    (question implied in a comment to another answer).


  • Related Answers
  • Michael Paulukonis

    In FileZilla 3+ , click on the "filter directory listings"* button on the task-bar for a listing of existing filters to apply, edit, or add your a custom filter.

    * it's the right-most button (with three arrows) in the middle-row in filter button, among others (image from http://wiki.filezilla-project.org/Using )

    Detailed info on FileZilla filters

  • Area 51

    Click on View -> Filename filters (Filezilla 3.3)