0

sry i'm not really familiar with $_FILES. but i have a quick question. why isnt this uploading?
here's my code:

<?php
$file = rand(10,100) . $_FILES["file"]["name"];
if ((($_FILES["file"]["type"] == "application/octet-stream"))
&& ($_FILES["file"]["size"] < 400000))
{
if ($_FILES["file"]["error"] > 0)
{
echo "Return Code: " . $_FILES["file"]["error"] . "<br />";
}
else
{
echo "Upload: " . $file . "<br />";
echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />";
if (file_exists("themes/" . $file))
{
echo $file . " already exists. ";
}
else
{

move_uploaded_file($file,
"themes/" . $file);
echo "Stored in: " . "themes/" . $file;
}
}
}
else
{
echo "Invalid file. Must be .ptf.";
}
?>
3
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by NavedAhmed
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.