File is empty. Please upload something more substantial.

File is empty. Please upload something more substantial. WordPress File is empty error. Please upload something more substantial. The hardest part about correcting this error? That the very suggestions it makes within the error message itself to correct it, don’t work. And there are years and years of threads all over the web that talk about this problem, none with solutions.

I can not solved this problem when it manifested on a long time client’s site from 2007 by doing a fresh installation of WordPress. Once i did that and connected up the database and content files, it did not worked as well. This was after days and days of struggling to figure out what the heck was going on and thinking it was a server-side issue. After all, that’s what the error says – update your server files!

The 5 minute install was exactly that. But then I lost many hours of my life with this 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.

Every time I attempted to upload a media file I was confronted with this problem. And funny weird thing is WordPress version can be updated, plugins and themes can be newly install and update as well. Upload size had been set 16M too. Permission for all files and folder are in a correct manners as it should be. What is going on?

So i enable debug via wordpress, then enable error logs. At last, there were no clues what-soever not a single error pops up. No logs on the server side could even help me. The only error was the same old above error keep showing up once i upload files, does not matter what files i was uploading.

So how do you fix this?
Reason its from the file: wp-admin/includes/import.php

function wp_import_handle_upload() {
if ( ! isset( $_FILES[‘import’] ) ) {
return array(
‘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.’ )
);
}

$overrides = array( ‘test_form’ => false, ‘test_type’ => false );
$_FILES[‘import’][‘name’] .= ‘.txt’;
$upload = wp_handle_upload( $_FILES[‘import’], $overrides );

What is causing WordPress file empty error on uploads?
PHP file upload script does not work

Symptoms

# PHP file upload script does not work;
# There are no errors in the web server or PHP logs;
# Issue persists with both Nginx and Apache being the main web server;
# Following error occurs in uploading a file in WordPress admin dashboard:

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.

Reason of Cause
file_uploads directive is switched off.

Resolution to solve it

# Log into Cpanel.

Go to MultiPHP INI Editor > Editor Mode > select your domain > type file_uploads=on and save

# Log into Plesk.

Allow file uploading in Plesk > Domains > example.com > PHP Settings > file_uploads > choose On from the drop-down menu

Leave a Reply

Your email address will not be published. Required fields are marked *