I have tried another simple example that seems to work for other people but not for me.
This is the code:
PHP Code:
$uploaddir = '/usr/../../products/';
$filename = $_FILES['picture1']['name'];
$filesize = $_FILES['picture1']['size'];
$tmpname_file = $_FILES['picture1']['tmp_name'];
if($filesize > '5000000') {
echo "This file is to big to upload.";
} else {
move_uploaded_file($tmpname_file, "$uploaddir$filename");
echo "Image upload successful to ".$uploaddir.$filename;
}
The output is:
Code:
many Notice: Undefined index: picture1 in /../...php on line 217
Image upload successful to /usr/.../products/
But theres no image uploaded. Or filename added to database record. I also changed the code from ['picture1'] to [$picture1] and it said undefined index filename.jpg so I know its getting the information its just not getting it right. echo "testing $filename = " . $filename; outputs testing =
Any help would be great... will have to go back to storing BLOBs if these simple examples don't work.
Thanks