Can I upload an entire folder using FTP?

Solution 1:

You can use ncftpput. Do the following:

  1. Install ncftp:

    yum install ncftp
    

yum is lowercase.

Alternatively:

    apt-get install ncftp

2. Execute the following command:

    ncftpput -R -v -u "ftp-username" ftp.website.com ftp-upload-path local-path/*

Solution 2:

If you're using a standard command-line ftp client, the MPUT command will allow you to transfer all files matching a (shell glob-style) pattern, so MPUT * will send all files in the current directory. There is also MGET to retrieve files matching a pattern.

By default, both MPUT and MGET will prompt for whether to transfer each file before doing so. You'd probably want to turn off prompting with the "PROMPT" command (no argument; it's a toggle).

Solution 3:

Use an FTP client such as LeechFTP or FileZilla or something similar. Many people swear by CuteFTP, but it's shareware last I checked. All support transferring a whole folder including directory structure.

Solution 4:

  1. have the user/client zip the folder
  2. upload the zip file
  3. unzip the folder server side.

Solution 5:

A simple tutorial for other Windows newbies like me who wind up here:

The easiest way to upload an entire folder (with all subfolders and files in them) is:

  1. Download NcFTP Client (it's free, but you can donate) from this link.
  2. Choose NcFTP Client 3.2.5 for Microsoft Windows from the list.
  3. Install it.
  4. When done, a small CMD window with a cherries icon will pop-up. You don't need it.
  5. Just open a standard CMD window and type:
    ncftpput -u *yourUserNameHere* -p *yourUserPasswordHere* -R *www.yourWebsite.com* /
                     _C:\yourFolderDirectoryHere\\*_
    (as one line).

Note that:

  • -R is a flag for "recursive"; it makes the command copy all subfolders recursively
  • / (slash) is your website's root directory
  • C:\yourFolderDirectoryHere\* selects everything inside C:\yourFolderDirectoryHere