Updated report: I forgot to add the slash in front of upload/. -.- Anyway, here's the new code:
And the new output:
I think it has to do with the host -.- So, anybody got suggestions other than 000webhost for a free host so that I can put up my site?
Code:
<?php
if (((strchr($_FILES["file"]["type"],"image/")))
&& ($_FILES["file"]["size"] < 200000))
{
if ($_FILES["file"]["error"] > 0)
{
echo "Return Code: " . $_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 "Temp file: " . $_FILES["file"]["tmp_name"] . "<br />";
if (file_exists("/upload/" . $_FILES["file"]["name"]))
{
echo $_FILES["file"]["name"] . " already exists. ";
}
else
{
if (move_uploaded_file($_FILES["file"]["tmp_name"],
"/upload/" . $_FILES["file"]["name"])) {
echo "Stored in: " . "admin/upload/" . $_FILES["file"]["name"];
}
else {
echo "Upload error: " . $_FILES["file"]["name"] . " not uploaded.";
}
}
}
}
else
{
echo "Invalid file; file type was " . $_FILES["file"]["type"];
}
?>
And the new output:
Quote:Upload: 1.TIF
Type: image/tiff
Size: 2.642578125 Kb
Temp file: /www/99k.org/k/e/y/keybored/htdocs/php5421lV
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to access /upload/1.TIF in /www/99k.org/k/e/y/keybored/htdocs/admin/image_upload_file.php on line 30
Upload error: 1.TIF not uploaded.
I think it has to do with the host -.- So, anybody got suggestions other than 000webhost for a free host so that I can put up my site?