Wordpress problem uploading new media : File is empty. Please upload something more substantial

admin2025-06-04  1

I'm running a 4.1.1 Wordpress without plugins and while trying to upload an image (2mb in this exemplary case) I get:

    'http error'

when I retry it returns

has failed to upload due to an error File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your php.ini or by post_max_size being defined as smaller than upload_max_filesize in php.ini. '

I have googled (of course) and checked my php.ini settings using phpinfo inside the /wp-content directory.

    file_uploads on
    memory_limit 128M
    upload_max_file_size 25M 
    post_max_size 25M

The permissions on /wp-content as well as /wp-content/uploads are in order. the tmp directory is writable and the disk is not full.

I have walked through these 2 questions arlready:

  • WordPress File Upload always give PHP.ini error (Updated)
  • Error “file is empty” when uploading images in WordPress

Not going to mention all Wordpress forum posts and not running on bluehost or anything like that. Running on my own iron box (Debian)

Any clues?

I'm running a 4.1.1 Wordpress without plugins and while trying to upload an image (2mb in this exemplary case) I get:

    'http error'

when I retry it returns

has failed to upload due to an error File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your php.ini or by post_max_size being defined as smaller than upload_max_filesize in php.ini. '

I have googled (of course) and checked my php.ini settings using phpinfo inside the /wp-content directory.

    file_uploads on
    memory_limit 128M
    upload_max_file_size 25M 
    post_max_size 25M

The permissions on /wp-content as well as /wp-content/uploads are in order. the tmp directory is writable and the disk is not full.

I have walked through these 2 questions arlready:

  • WordPress File Upload always give PHP.ini error (Updated)
  • Error “file is empty” when uploading images in WordPress

Not going to mention all Wordpress forum posts and not running on bluehost or anything like that. Running on my own iron box (Debian)

Any clues?

Share Improve this question edited Jul 18, 2018 at 9:21 Glorfindel 6113 gold badges10 silver badges18 bronze badges asked Feb 25, 2015 at 10:24 Martijn BeekhuisMartijn Beekhuis 11 gold badge1 silver badge2 bronze badges 0
Add a comment  | 

2 Answers 2

Reset to default 0

Be sure that all above mentioned php.ini values are valid on the wordpress root folder.

When you only apply these for /wp-content (and up) you get the above weirdness.

I had a lot of problem with this error related to some user roles. "Admin" and "author" could upload full size images (25mb in my case), but i.e. "contributor" only 2mb or receive this error. I think it's due to some permissions related to image management interface. And some plugin add several roles with different permission (i.e. commerce plugins add "vendor" role). After some troubles, I resolved using Role Editor Plugin and enabling "edit_published_posts" (under core) to user roles that have this problem (in my case "Vendor)".
I hope this can help somebody.

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

最新回复(0)