Updated!
I have never had a problem with this before, i'm on a local server and UAC is turned off as well.
Here is my form, well, a dumbed down version of the form as there is a lot of text in there:
<form id="setup" name="setup" action="php/process_setup.php" method="post" enctype="multipart/form-data">
<input type="text" name="cname" id="cname" value="" />
<input type="text" name="splash" id="splash" />
<input type="file" name="file"/>
<input type="text" name="email" id="email" />
<input type="password" name="password" id="password" />
<input type="password" name="cpassword" id="cpassword" />
<input type="submit" value="Submit" name="submit_setup" />
</form>
Here is the PHP im trying:
if ($_FILES["file"]["error"] > 0)
{
echo "Error: " . $_FILES["file"]["error"] . "<br>";
}
else
{
echo "Upload: " . $_FILES["file"]["name"] . "<br>";
echo "Type: " . $_FILES["file"]["type"] . "<br>";
echo "Size: " . ($_FILES["file"]["size"] / 1024) . " kB<br>";
echo "Stored in: " . $_FILES["file"]["tmp_name"];
}
And here is the result:
Notice: Undefined index: file in C:\xampp\htdocs\ppa\php\process_setup.php on line 10
Notice: Undefined index: file in C:\xampp\htdocs\ppa\php\process_setup.php on line 16 Upload:
Notice: Undefined index: file in C:\xampp\htdocs\ppa\php\process_setup.php on line 17 Type:
Notice: Undefined index: file in C:\xampp\htdocs\ppa\php\process_setup.php on line 18 Size: 0 kB
Notice: Undefined index: file in C:\xampp\htdocs\ppa\php\process_setup.php on line 19 Stored in:
Edit 2
Just did a test to see if PHP has write permission, here is the code:
echo copy("1383778885275.jpg", "C:/xampp/tmp/1383778885275.jpg");
And the result was:
1
And the image IS in the tmp directory..
&& isset($_FILES["file"]["tmp_name"]) && !empty($_FILES["file"]["tmp_name"])because thetmpfile doesn't exist "yet". So of course it will fail.empty()checks if variable is set as well, soisset()is not neededtmp_name. But you should change'!empty($_FILES["file"]["tmp_name"]toisset($_FILES["file"]["tmp_name"].