6

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?

  • 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 '14 at 6:14
12

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.

  • 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 '15 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 '18 at 12:53
  • Wow, never knew this setting even existed. – Abdul Sadik Yalcin Nov 9 '18 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.

  • My "upload_path" is empty. What means that? – Vassilis Jul 26 '16 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. – Fernando Mata Jan 24 '18 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

protected by Community Dec 21 '16 at 16:22

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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