Hi, I'm trying to upload the image reference name to the database using file upload.
I'm using localhost, and the code is:
if ((isset($POST["MM_insert"])) && ($POST["MM_insert"] == "form1")) {
$target = "Photos/";
echo $target ."|";
$target = $target.basename($FILES['fileToUpload']['name']);
echo $target."|";
move_uploaded_file($FILES['fileToUpload']['tmp_name'], $target );
echo $_FILES['fileToUpload']['name'] ."|";
[COLOR="Red"]if (is_uploaded_file($_FILES['fileToUpload']['tmp_name'])) {
echo "File ". $FILES['fileToUpload']['name'] ." uploaded successfully.\n";
}[/COLOR]
$insertSQL = sprintf("INSERT INTO gallerytbl (img_filename, thumb_filename, img_caption) VALUES (%s, %s, %s)",
GetSQLValueString($FILES['fileToUpload']['name'], "text"),
GetSQLValueString($POST['tn_fileToUpload'], "text"),
GetSQLValueString($POST['caption'], "text"));
This is the echo result:
Photos/|Photos/TN_temple_zeus01.JPG|TN_temple_zeus01.JPG|
So my question is y after i move_uploaded_file($_FILES['fileToUpload']['tmp_name'], $target );
the file is not moved to the target??
Pls help.. i dying of frustrations already.....