$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>Wordpress problem uploading new media : File is empty. Please upload something more substantial|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

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

matteradmin10PV0评论

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.

Post a comment

comment list (0)

  1. No comments so far