I'm tring to run a file upload script that goes this way:
I got the message File upload error which means (from my script) this: if(is_uploaded_file($_FILE['ad']['tmp_name'])){
...
}
was omitted.
what could be wrong?
Code:
if($_POST['ad']){
print_r($_FILES);//just doing a little debugging trick here
if(is_uploaded_file($_FILE['ad']['tmp_name'])){
if($_FILES['ad']['type'] == 'image/gif' || $_FILES['ad']['type'] == 'application/x-shockwave-flash'){
//trying to use this: ...
//'application/x-shockwave-flash' to allow flash as well...
//hope correct
if(move_uploaded_file($_FILES['ad']['tmp_name'], 'var/www/ng/ngbot/ads/'.$_FILES['ad']['tmp_name'])){
echo "uploaded";
}
}else{
echo "Invalid file type!<p>";
}
}else{
echo "File upload error!<p>".$_FILES['ad']['error'];
}
}
...
}
was omitted.
what could be wrong?