o to kod
<? //check if they decided to upload a pic: if($_FILES['userfile']['size'] > 1) { $max_size = 10000000000; $max_height = 300; $max_width = 300; } //check file-size (in bytes): if(($_FILES['userfile']['size'] > $_POST['MAX_FILE_SIZE']) || ($_FILES['userfile']['size'] > $max_size)) { } //check the extension. $ext = $array[$nr-1]; if(($ext !="jpg") && ($ext !="jpeg") && ($ext !="png")) //CHECK TYPE: (what the browser sent) if(($_FILES['userfile']['type'] != "image/jpeg") && ($_FILES['userfile']['type'] != "image/pjpeg") && ($_FILES['userfile']['type'] != "image/png")) { } //DOUBLE CHECK TYPE: if image MIME type from GD getimagesize() -In case it was a FAKE! if(($info['mime'] != "image/jpeg") && ($info['mime'] != "image/pjpeg") && ($info['mime'] != "image/png")) { } //check file size (length & width) if(($info[0] > $max_width) || ($info[1] >$max_height)) { die("<BR><BR>Obrazek jest za duży(<b>" . $info[0] . "</b> x <b>" . $info[1] . "</b>). Maksymalny rozmiar obrazka ". $max_height . " x ". $max_width ."."); } //rename file, move it to location. //get max number of images the user has uploaded $m = mysql_query("SELECT max(user_images) as `total_images` FROM `images` WHERE `user_id` = '".$_SESSION['user_id']."'"); if($result->total_images <= 0) { $image_number = 1; } else { $image_number = $result->total_images + 1; } //end if if(move_uploaded_file($_FILES['userfile']['tmp_name'] , $_SERVER['DOCUMENT_ROOT']."/img/".$filename . '.' . $ext)) { } else { }//end upload } //end is_uploaded_file } else { //display form ?> <form enctype="multipart/form-data" action="<? $_SERVER['PHP_SELF']; ?>" method="post" name="uploadImage" /> <input type="hidden" MAX_UPLOAD_SIZE = "10000000000" /> <input type="file" name="userfile" size="35" /> <input type="submit" name="submit" value="Upload Image"> <? } //end else ?>
za kazdym razem pokazuje mi się informacja o zbyt duzym rozmiarze pliku, czy ktoś może mi pomoc i powiedziec gdzie jest blad?
