I Have this code:
$filename=$_FILES["fileToUpload"]["name"];
$extension=explode(".", $filename);
$newfilename=$rezeptID .".".$extension;
if ($_FILES["fileToUpload"]["error"] > 0)
{
echo "Return Code: " . $_FILES["fileToUpload"]["error"] . "<br />";
}
else
{
echo "Upload: " . $_FILES["fileToUpload"]["name"] . "<br />";
echo "Type: " . $_FILES["fileToUpload"]["type"] . "<br />";
echo "Size: " . ($_FILES["fileToUpload"]["size"] / 1024) . " Kb<br />";
echo "Temp file: " . $_FILES["fileToUpload"]["tmp_name"] . "<br />";
if (file_exists("/Images/Rezepte/" . $_FILES["fileToUpload"]["name"]))
{
echo $_FILES["fileToUpload"]["name"] . " already exists. ";
}
else
{
move_uploaded_file($filename,
"/Images/Rezepte/" . $newfilename);
echo "Stored in: " . "/Images/Rezepte/" .$newfilename;
}
}
The variable $rezeptinfo is just a number and is correct, if you wonder.
When I now submit my form, I get this info about the file:
"Upload: Type: Size: 0 Kb Temp file: Stored in: /Images/Rezepte/10."
Why are the extension of the file and all the basic information mssing. 10 is the value of $rezeptID. What am i doing wrong?