upload issue
| From: | nihilism machine | Date: | Sun, 17 Feb 2008 18:22:03 +0000 |
| Subject: | upload issue | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-269440@lists.php.net to get a copy of this message | ||
any idea why this fails?this is the error: "Sorry, there was a problem uploading your file"
<?php
require_once("classes/db.class.php");
$target = "";
$fileName = basename( $_FILES['uploaded']['name']);
$extension = strtolower(strrchr($fileName,"."));
$DB = new DB();
$insertID = $DB->insert_sql("INSERT INTO CMS_Media (File_Name) VALUES ('')");
$target = "media/" . $insertID . $extension;
//echo $target;
if (move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)) {
// Error
echo "File was uploaded!";
} else {
echo "Sorry, there was a problem uploading your file.";
}
chmod($target, 0755);
header("Location: crop.php?imageName=$newFileName");
?>
-------------------------------
Edward H. Hotchkiss
Chief Technical Officer
Durgle, INC
edward@durgle.com
http://www.durgle.com
-------------------------------