I've WampServer 2 placed on my Home windows 7 computer. I am using Apache 2.2.11 and PHP 5.2.11. After I make an effort to upload any file from the form, it appears to upload, however in PHP, the $_FILES array is empty. There's no file within the c:wamptmp folder. I've set up PHP.INI to permit file uploads and the like. The tmp folder has read/write rights for that current user. I am stumped.

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<form enctype="multipart/form-data" action="vanilla-upload.php" method="POST">
Choose a file to upload: <input name="uploadedfile" type="file" /><br />
<input type="submit" value="Upload File" />


echo 'file count=', count($_FILES),"\n";
echo "\n";

Although unusual, but in the PHP Manual page comment :

When the $_FILES array all of a sudden goes inexplicably empty, despite the fact that your form appears correct, you can examine the disk space readily available for your temporary folder partition. During my installation, all file uploads unsuccessful unexpectedly. After much gnashing of teeth, I attempted clearing up additional space, then file uploads all of a sudden labored again.

And here's the check-list for file uploading in PHP:

  1. Check php.ini for file_uploads = On, post_max_size, and upload_max_file_size. Make certain you’re editing the right php.ini – use phpinfo() to ensure your configurations. Make certain you do not misspell the directives as 8MB rather than the expected 8M!
  2. Don't use javascript to disable your form file input area on form submission!
  3. Make certain your directory has read+write permissions looking for the tmp and upload sites.
  4. Make certain your file destination and tmp/upload sites don't have spaces inside them.
  5. Make certain all FORMs in your page have /FORM close tags.
  6. Make certain your FORM tag has got the enctype="multipart/form-data" attribute. Not one other tag works, it needs to become your FORM tag. Make sure that multipart/form-information is encircled by STRAIGHT QUOTES, not wise quotes copied and pasted in from Word OR from the website blog (WordPress converts straight quotes to position quotes!). For those who have multiple forms around the page, make certain both of them have this attribute. Type them in by hand, or try straight single quotes entered by hand.
  7. Make certain your FORM tag has method="POST". GET demands don't support multipart/form-data uploads.
  8. Make certain your file input tag includes a Title attribute. An ID attribute isn't sufficient! ID characteristics are to be used within the DOM, not for Publish payloads.
  9. Also make certain the file you're uploading doesn't have any non-alpha number figures inside it.
  10. Once, I simply spent hrs trying to puzzle out why it was happening in my experience out of the blue. It switched out which i had modified a few of the PHP configurations in .htaccess, and one of these (unsure which yet) was leading to the upload to fail and $_FILES to become empty.

Finally, try uploading really small files.

So far as the HTML you have the symptoms of set that part up properly. You have the enctype="multipart/form-data" which is essential to possess around the form.

So far as your php.ini setup, sometimes on systems multiple php.ini files exist. Make sure you are editing the most appropriate one. I understand you stated you've set up your php.ini file to possess file uploads, but have you also set your upload_max_file_size and publish_max_size to become bigger compared to file you are attempting to upload? So you ought to have:

file_uploads = On; sounds like you already did this
post_max_size = 8M; change this higher if needed
upload_max_file_size = 8M; change this higher if needed

Does your directory: "c:wamptmp" have both read permissions? Have you make sure to restart Apache once you made the php.ini changes?

Thanks everyone for that vary comprehensive replies. Individuals are very useful. The solution switched to be something very odd. It works out that PHP 5.2.11 does not such as the following:

publish_max_size = 2G


publish_max_size = 2048M

Basically change it out to 2047M, the upload works.