Uploading files via FileZilla ending in failure

August 16, 2014 51.9k views

I was trying to upload a website that I’ve created onto a droplet server. Was able to login via FTP just fine (through FileZilla). When I tried moving my files to the /var/www directory it refused to upload the file. The reason for file transfer failure was that the directory was open for write: permission denied.

Here is the log:
Status: Starting upload of /Users/andrewp/Documents/FreelanceProjects/TechArtista+Kyte/kytesite/kytesite.html
Status: Retrieving directory listing…
Command: ls
Status: Listing directory /var/www/html
Command: put “/Users/andrewp/Documents/Freelance
Projects/TechArtista+Kyte/kytesite/kytesite.html” “kytesite.html”
Error: /var/www/html/kyte
site.html: open for write: permission denied
Error: File transfer failed
Status: Retrieving directory listing…
Command: ls
Status: Listing directory /var/www/html
Status: Directory listing successful

More details:

  • My droplet is running Ubuntu 12.04 and I’ve installed LAMP stack.
  • I connected via SFTP, (port 22) on FileZilla

This is the first time I’ve done anything like this so help would be great :)

4 Answers

Hello! If you connect to the droplet through SSH and run the following command, that should allow permissions for the folder:

sudo chown user /var/www

Replacing “user” with the actual username you are using for SFTP. I hope this helps!

I set ssh and made connection with filezilla but getting same error:

File transfer failed

  • Hello! =)

    Try this (worked for me):

    sudo chown user /var/*

    (replace “user” to your actual username)

    sudo chmod 755 /var/*

    And after that restart your server and try transfer the files again.

I ran the above commands but it didnt work until i tried the solution found here:
http://yogodoshi.com/how-to-fix-open-for-write-permission-denied-error-sftp/

Have another answer? Share your knowledge.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!