Trying to copy a file in PHP and get this error in ini_set…
Notice: Undefined index: upload in /Applications/MAMP/htdocs/lostpet3/postaction.php on line 36
Here’s my dump…..any ideas why if(move_uploaded_file($_FILES[‘uploadedfile’][‘tmp_name’], $target))
won’t work? My code is below…
POST:Array
(
[date1] => 04/21/2011
[optType] => Dog
[optStatus] => Lost
[txtName] => sdtsd
[txtDescription] => edfds
[txtContact] => dsfsd
[txtArea] => dsfdsfsd
)
FILES:Array
(
[Upload] => Array
(
[name] => IMG_6539.jpg
[type] => image/jpeg
[tmp_name] => /Applications/MAMP/tmp/php/phpkJ4Q00
[error] => 0
[size] => 4831277
)
)
Notice: Undefined index: upload in /Applications/MAMP/htdocs/lostpet3/postaction.php on line 36
Notice: Undefined index: uploadedfile in /Applications/MAMP/htdocs/lostpet3/postaction.php on line 39
Notice: Undefined index: uploadedfile in /Applications/MAMP/htdocs/lostpet3/postaction.php on line 41
Notice: Undefined index: uploadedfile in /Applications/MAMP/htdocs/lostpet3/postaction.php on line 46
Sorry, there was a problem uploading your file.
=================================
$target = “gallery/”;
$target = $target . basename( $_FILES[“uploadedfile”][“name”]);
if(move_uploaded_file($_FILES[‘uploadedfile’][‘tmp_name’], $target))
{
echo “The file “. basename( $
}
else {
echo “<BR>Sorry, there was a problem uploading your file.<BR>” . basename($_FILES[‘uploadedfile’][‘name’]);
}
exit();