hi every body,
i am using the following code to upload an image. it directly jumps to the error message please tell me what im doing wrong here.
this is displaying "Image file nto uploaded successfully". please tell me whats wrong with it.
i am using the following code to upload an image. it directly jumps to the error message please tell me what im doing wrong here.
Code:
<form name="myform" enctype="multipart/form-data" method="post" action=""> Upload Album/Artist Image : <input type="file" name="imguploader"> <br /> <input type="submit" value="uploadnow" name="yes" /> </form> <?php extract($_POST); if($yes){ $img_types2 = array("image/gif","image/pjpeg","image/jpeg","image/jpg","image/bmp","image/png"); if($_FILES["imguploader"]["name"]!="" && in_array($_FILES["imguploader"]["type"],$img_types2)){ $img2 = time()."_".str_replace(" ","_",$_FILES["imguploader"]["name"]); move_uploaded_file($_FILES["imguploader"]["tmp_name"],"images/".$img2); } else { echo "Image file not uploaded successfully."; } } ?>
this is displaying "Image file nto uploaded successfully". please tell me whats wrong with it.
Comment