Chempo
By:
Chempo

I can upload files to my server using FileZilla, but uploaded files are not found online.

January 27, 2015 5.5k views

Hi,

Title says it all. I can upload files to my server using FileZilla, but uploaded files are not found online.

For example:

I have my site on chempo.com domain.

on the server I have folder named 'images' for storing media. I uploaded today a file called 'thumbnail.png'. By logic now if you go to chempo.com/images/thumbnail.png you could access it. But it gives 404 error.

Do I need to change something in the .htaccess file or something else?

Thank you in advance.

6 comments
  • Are you uploading your files to your web root? When logging in as root via SFTP you start out in the directory /root. By default your web files should be in /var/www/html. If you are uploading files to your /root directory they will not be accessible.

  • yeah I am posting them here /var/www/chempo.com/public_html/images

  • Are the file permissions similar to other working web content? Are you uploading as your root user and the web server doesn't have access etc? can you list the permissions of your files

  • I am uploading as root and file has the same permissions as the other ones.

  • Your web server may not serve files owned by root properly as the web server, running as www-data may not be able to see these files. You should ensure that files you are serving via your web server are owned by this user by running:

    chown -Rf www-data:www-data /var/www/
    
  • Hey man, I actually found out (sort of) what's the problem and I opened a new question (sorry, I dont know how to delete questions). New question is here: https://www.digitalocean.com/community/questions/files-on-the-server-loads-only-when-it-is-accessed-through-www

    Can your answer still be solution?

Be the first one to answer this question.