php - Upload file could not be moved to wp-contentuploads

admin2025-01-08  5

I know it has been asked over and over again on the internet and i spend hours digging deeper into the web. But the no answer so far.

Why we get this error when you upload a file
The uploaded file could not be moved to wp-content/uploads

  1. I tried various file persimission on folders and files in the ftp.
  2. Tried a fresh install WP.
  3. I tried this code define( 'UPLOADS', 'wp-content/uploads' );
  4. I tried adding the path in the wp/options.php location for upload_path.
  5. I created the upload folder manually, because when i installed WP the wp-content folder does not have any folder named uploads

But nothing so far..

Local Server
There is no issue so far in the local server.

I am just a beginner and learning WordPress from scratch. The only issue i got stuck is this file upload thing.

Can anyone help me!

I know it has been asked over and over again on the internet and i spend hours digging deeper into the web. But the no answer so far.

Why we get this error when you upload a file
The uploaded file could not be moved to wp-content/uploads

  1. I tried various file persimission on folders and files in the ftp.
  2. Tried a fresh install WP.
  3. I tried this code define( 'UPLOADS', 'wp-content/uploads' );
  4. I tried adding the path in the wp/options.php location for upload_path.
  5. I created the upload folder manually, because when i installed WP the wp-content folder does not have any folder named uploads

But nothing so far..

Local Server
There is no issue so far in the local server.

I am just a beginner and learning WordPress from scratch. The only issue i got stuck is this file upload thing.

Can anyone help me!

Share Improve this question asked Sep 30, 2016 at 9:09 DexterDexter 1671 silver badge12 bronze badges 2
  • 1 Whatever user your webserver runs as must have write access to the wp-content/uploads directory in order to upload files. You may have to consult your hosting company for assistance. – Pat J Commented Oct 13, 2016 at 14:42
  • @PatJ i tried all the permission, and nothing seems to working. Alternatively iam using an external URL to upload the file. – Dexter Commented Oct 14, 2016 at 4:09
Add a comment  | 

2 Answers 2

Reset to default 1

I experienced this error while preparing an AWS ec2 Bitnami micro-instance configured for WordPress. This approach requires the command-line, so please launch a terminal-session and begin via SSH into the deployed production.

  1. cd into the application document-root:

    /home/bitnami/apps/wordpress/htdocs:

  2. Execute the below command to identify the Apache web-server:

    ps aux | egrep '(apache|httpd)'

    Revealing daemon in this case, as captured within the terminal-output screenshot below:

  3. Ultimately, the below-command remediated the error; users should now have the ability to successfully media-upload content via the WordPress Content Management system/admin-panel:

    sudo chown -R daemon:daemon wp-content

I recommend the following dox for guidance regarding the Linux-commands referenced herein:

  • Finding out what user Apache is running as?
  • what does this line mean on my ps aux ../apache2 -k start

Update: Permissions were correct, there was enough storage.

What fixed it for me was deleting the month folder (08 in my case) and when re-uploading image, website recreated the folder and it worked fine :)

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1736270991a1481.html

最新回复(0)