8

I did a manual backup and re-install of a WP site, and it worked fine. Then my client updated some plugins, regretted it and asked me to restore the site to its previous state. I used the same backup I had from the first time, but now it turns out my client can't upload media.

I go to the site to try and upload an image and I get no error messages, as if the image had uploaded just fine. But I get a broken image icon instead of the usual preview, and if I follow the image link I get a 'page not found (404)'. The URL path is were the image should have been uploaded to, but checking the FTP folder the image is not there.

All folders have 755 permissions (all files are 644). I tried changing the folders' to 777 (just for test) but to no avail. I still get a broken image icon and no image uploads to the actual folder.

The only place I can see the image is if I go to the edit option (and click edit again) I can see it in the editing textarea. And if I open that same image in a new tab the URL is something like mysite.com/blog/wp-admin/admin-ajax.php?action=imgedit-preview[...].

I searched some questions before posting, but most were solved changing permissions back and forth, or it was an issue between user and owner permissions. I tried the first and didn't work, and the second doesn't really apply to me, I think, because the first time I did the install the site was working fine under the same user as now. The problem is pretty much the same as this question, except I have no .htaccess file in the way.

Does anyone have an idea of what the problem could be?

1
  • the first problem is that, you havent pasted the link of your site and sample links of your "uploaded" images. If you have done that, i might have already answered your question, but now i may not see this topic again ude to the time shortage ((
    – T.Todua
    Sep 12, 2014 at 6:14

3 Answers 3

17

I found the problem. In settings > media the folder for uploads was actually pointing to a different path. Once I redirected it to wp-content/uploads it all worked.

3
  • You can also do this directly with the Uploads constant, in your functions.php or somewhere else that gets loaded. define( 'UPLOADS', 'wp-content/uploads' ); Source.
    – yuvilio
    Jul 24, 2015 at 19:04
  • 1
    I lost so much time fiddling with folder rights until I came across this... You're a savior.
    – KalenGi
    Oct 2, 2018 at 12:53
  • 1
    Wow, never knew this setting even existed. Nov 9, 2018 at 0:26
5

If you moved your page from one host to another - check if your Upload path is correct to your new host (and not a leftover from previous host)

Navigate to: http://YOURDOMAIN/wp-admin/options.php

Find the field for "upload_path" and cross check.

2
  • My "upload_path" is empty. What means that?
    – Vassilis
    Jul 26, 2016 at 13:43
  • I just created an account to say "THANK YOU!". Also to add, if you have a multisite as I do, remember to check this field on every "options.php" file for all your sites, one by one. This should fix the issue. Jan 24, 2018 at 4:21
0

Are you still able to access the setting to change the media uploads folder? I cloned a site and was able to see a long directory name on the Settings > Media page.

I changed it to "wp-content/uploads" and saved - at which point the entry field was removed! It seems the feature was taken away in WP3.6m and now can onlt be changed in WP-config or in the database through phpMyAdmin

Not the answer you're looking for? Browse other questions tagged or ask your own question.