Uploaded File via SSH - can't make it downloadable


#1

I uploaded a file via SSH/SFTP and changed the permission via CHMOD. The permissions are the same as all of the other files in the directory, but the file is still not downloadable. Other files that I uploaded through the Wordpress Web Interface are downloadable.

Here’s what I see when I do an “ls -l” command for the non-downloadable and downloadable files:

-rw-r--r-- 1 user pg1234567  6080217 Jul  2 22:00 file_that_will_not_download.zip
-rw-r--r-- 2 user pg1234567  2979115 Jul  2 22:45 file_that_will_download.zip

I’m guessing it’s because the web server user group is different from the SSH user used to upload (i.e. the number “1” vs. the number “2” between the permissions and the user name.) But I’m not sure what I’m supposed to do to change the group and/or security because I’ve already made the change via CHMOD and they match.
Any suggestions? Am I missing something simple?


#2

Both files are readable by everybody, so that doesn’t look like the problem. What error are you getting when you try to download?


#3

Where is these files located?


#4

The files are located in

I get a 404 error for the “will not download file”.

The only difference is the “1” vs. the “2” between the permissions and the username. All of the other files in the directory have a “2” and they download fine. I don’t know what the “1” vs. the “2” means and if it has any correlation or not.

I disabled all caching in wordpress and still no fix.


#5

Which user owns the wp-content directory?


#6

It’s the same user name for everything. The wp-content and wp-content/uploads directory, as well as for all of the files.


#7

Seeing how it’s a 404, it makes me think there might be something wrong with the filename. Are they both all lower case with no symbols?


#8

Good thought, but no luck. I renamed the file to “test.zip” and it still gives a 404 error.


#9

I guess it’s time to file a support ticket. Let us know what they discover.


#10

It turned out to be a pretty simple solution, and not at all related to file permissions. I was logging in as USER01, which had an old copy of the domain files in the home directory. However, the existing working copy of the domain was being hosted under USER02.

So I logged in as USER02, uploaded the same file, did the chmod, and everything is fine. The problem was too many user names and home directories on my VPS… and too many copies of old versions of domains.


#11

Oops! Good thing you’ve got it figured out now.