-
PHP (
http://www.daniweb.com/forums/forum17.html)
- -
$_FILES help (
http://www.daniweb.com/forums/thread107305.html)
| kishou | Feb 2nd, 2008 3:16 am | |
| $_FILES help 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.";
}
?> |
| peter_budo | Feb 2nd, 2008 4:44 am | |
| Re: $_FILES help I see you marked your post as solved. Did you find solution? Would you mind to share it with Daniweb community? |
| All times are GMT -4. The time now is 2:04 am. | |
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC