The downloaded file cannot be moved to wp-content / uploads / 2015/01. image upload problem

I have been working on a WordPress website since two months, and I uploaded a lot of images before, but I get an error while uploading an image, and I encountered this problem after the new year: - The uploaded file cannot be transferred to wp- content / Additions / 2015/01.

There is a screenshot below: - The uploaded file could not be moved WordPress

+16
php wordpress
source share
10 answers

I searched and found that the problem is from the server provider.

As a rule, all files should belong to your user account (ftp) on your web server and should be writable by that account. On shared hosts, files should never belong to the web server process itself (sometimes it is www, apache or no one else).

Any file that needs write access from WordPress must belong to or belong to the user account group used by WordPress (which may be different from the server account). For example, you may have a user account that allows you to transfer FTP files back and forth to your server, but your server itself can operate using a separate user, in a separate user group, such as dhapache or nobody. If WordPress works as an FTP account, this account must have write permissions, i.e. Be the owner of the files or be a member of a group that has write access. In the latter case, this will mean that the permissions are set more strictly than by default (for example, 775 instead of 755 for folders and 664 instead of 644).

You can see here how to change the file resolution.

+5
source share

This article explains and solves the problem very well: http://2surge.com/how-to-fix-the-uploaded-file-could-not-be-moved-to-wp-content-error-message

The basic premise is that the identity of the process that starts the httpd / apache / web server stream must have write access to your download directory.

To fix the problem:

  • Check which account your web server is running on

    Update : on Unix use ...

    ps aux | egrep '(apache|httpd)'

    ... this will show the list of processes for the web server along with the identifier of the process in which it runs, for example, "nobody"

    nobody 8718 0.1 0.4 1332864 17180 ? Sl 17:11 0:06 /usr/local/apache/bin/httpd -k start -DSSL

  • Update the permissions of the download directory to allow this account to write to it.

    Update . On Unix, you can use ...

    chown -R nobody /<path to upload directory>/wp-content/upload/

    You can also change permissions for this account (in the right place) to make sure that it has write permissions using chmod or filezilla and cascade changes to directories as necessary.

Browse the related article for a detailed breakdown. Hope this helps! :)

+17
source share

This works for me.

 $ sudo chown -R _www uploads/ $ sudo chmod -R g+w uploads/ 

I assume you are in the wp-content directory.

+12
source share

You just need to give PHP permission to write to the uploads folder, this works for me:

 sudo chown -R www-data <path>/wp-content/uploads 
+3
source share

he probably does not have permission to create / uploads / 2015

Check if this folder exists, if so, check if / uploads / 2015/1 / exists.

permissions:

 chmod 755 /uploads/2015/1/ chown www-data:www-data /uploads/2015/1/ 

These folders must have the same permissions as the / uploads / folder. Also check error_log because it should show you which folder is causing the problem.

+2
source share

It works for me

 sudo chown -R www-data html 

Assuming the current directory is www

Ubuntu 16.04, Apache2

+1
source share

I also had this problem, and it turned out that this was due to the fact that the hosting storage quota was exceeded.

I found that there was an old script that recorded errors, and the error log became so large that it populated the available quota.

I finally realized this when I tried to create a new directory using FTP, and the server response was "disk quota exceeded."

0
source share

I got this error in cPanel hosting account, where there was no problem with disk quota (for account). After some time, I found that the cPanel tool "Select PHP version" was installed on v7.1, but several WordPress diagnostic tools found that v5.6 actually works, and they also found problems with the file system.

The File Manager tool in cPanel showed that all permissions were correct and the folders were writable.

One of the diagnostic tools I used was part of the Wordfence plugin. It was available in the "Toolbar" menu in Wordfence> Tools> Diagnostics (tab).

I reported this problem to the hosting company, and it seems to have fixed itself (the person who answered my support request indicated that he had not fixed anything). I think this was probably a symptom of a problem that affected several hosting accounts, and someone else at the hosting company probably discovered this and fixed it.

In case others run into a similar problem, I hope this answer helps them spend less time trying to find it. As soon as I found that the wrong version of PHP was working, I realized that this was probably not something that I could fix with cPanel access only.

0
source share

If you use something with SELinux (like Fedora or CentOS), you also need to set SELinux permissions. Assuming your directory is called uploads (for example)

 chcon -R -t httpd_sys_rw_content_t uploads 

This will install uploads and everything below it for the user to download the web server.

0
source share

It helped me to change the resolution to 777.

-7
source share

All Articles