conan318 Posted August 16, 2011 Share Posted August 16, 2011 hi i have upload script that is working if i upload small image files however if i try and upload an image over 2m it wont upload. i have changed the php ini file to 8m and still no luck any idea's on what else i can do so i can upload larger image file? and also need a way to check if the image upload is a .gif .jpeg.png. was thinking i should be able to put in if $ext==('.gif') and $ext==(.jpeg) and $ext ==('.png'){ upload file }else { echo "that is not a image file";\ would something like that work? f($_FILES[uploadedfile]!= none){ $ext_a = explode(".", $_FILES['uploadedfile']['name']); $ext = $ext_a[1]; /* hashes the file name with the date and time to genrate a uniue file name*/ $img=md5($_FILES['uploadedfile']['name'] . date("m.d.y H:m:s")) . "." . $ext; $target_path = "c://wamp/www/kurri/gallery/"; $target_path = $target_path .basename($img); $insert_user=mysql_query("INSERT INTO main.gallery (imgname,date,username) VALUES ('$img','$mk','$username')") ; if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) { echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded"; } else{ echo "There was an error uploading the file, please try again!"; } if($insert_user) { header("location:gal.php"); die();} else { echo "error in registration".mysql_error(); } } Quote Link to comment https://forums.phpfreaks.com/topic/244892-php-max-file-upload/ Share on other sites More sharing options...
chintansshah Posted August 16, 2011 Share Posted August 16, 2011 I didn't found move_uploaded_file function to move from tmp folder to destination folder. check http://php.net/manual/en/function.move-uploaded-file.php Quote Link to comment https://forums.phpfreaks.com/topic/244892-php-max-file-upload/#findComment-1257990 Share on other sites More sharing options...
The Little Guy Posted August 16, 2011 Share Posted August 16, 2011 $filename = "/root/image/myimage.jpg"; if((bool)exif_imagetype($filename)){ echo "This is a valid image"; }else{ echo "This is not a valid image"; } Quote Link to comment https://forums.phpfreaks.com/topic/244892-php-max-file-upload/#findComment-1257999 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.