1 – Check php.ini for:

file_uploads = On
post_max_size = 100M
upload_max_filesize = 100M
You might need to use .htaccess or .user.ini if you are on shared hosting and don’t have access to php.ini.

Make sure you’re editing the correct ini file – use the phpinfo() function to verify your settings are actually being applied. You can also use:

Also make sure you don’t misspell the sizes – it should be 100M not 100MB.

2 – Make sure your

tag has the enctype=”multipart/form-data” attribute. No other tag will work, it has to be your FORM tag. Double check that it is spelled correctly. Double check that multipart/form-data is surrounded by STRAIGHT QUOTES, not smart quotes pasted in from Word OR from a website blog (WordPress converts straight quotes to angle quotes!). If you have multiple forms on the page, make sure they both have this attribute. Type them in manually, or try straight single quotes typed in manually.

3 – Make sure you do not have two input file fields with the same name attribute. If you need to support multiple, put square brackets at the end of the name:

4 – Make sure your tmp and upload directories have the correct read+write permissions set. The temporary upload folder is specified in PHP settings as upload_tmp_dir.

5 – Make sure your file destination and tmp/upload directories do not have spaces in them.

6 – Make sure all

‘s on your page have

close tags.

7 – Make sure your FORM tag has method=”POST”. GET requests do not support multipart/form-data uploads.

8 – Make sure your file input tag has a NAME attribute. An ID attribute is NOT sufficient! ID attributes are for use in the DOM, not for POST payloads.

9 – Make sure you are not using Javascript to disable your field on submission

10 – Make sure you’re not nesting forms like

11 – Check your HTML structure for invalid/overlapping tags like

12 – Also make sure that the file you are uploading does not have any non-alphanumeric characters in it.

13 – You could potentially try avoiding underscores (_) in the name=”” attribute of the tag

14 – Try uploading very small files to narrow down whether it’s a file-size issue.

15 – Check your available disk space. Although very rare, it is mentioned in this PHP Manual page comment:

If the $_FILES array suddenly goes mysteriously empty, even though your form seems correct, you should check the disk space available for your temporary folder partition. In my installation, all file uploads failed without warning. After much gnashing of teeth, I tried freeing up additional space, after which file uploads suddenly worked again.

I hope that helps!


About the author Mughees: Hey! My name is Mughees Hafeez, i'm a WordPress Expert Developer, i create high level themes and plugins, and i provide free stuff every week on this website!

Leave a comment