הינה הקוד:
PHP קוד:
<?
$dir="../idopic/large/";
$output="../idopic/small/";
$width="80";
$height="80";
function randFname($ext){
global $dir;
$fname=0;
while(file_exists($dir.$fname.".".$ext)){
$fname++;
}
return $dir.$fname.".".$ext;
}
foreach($HTTP_POST_FILES as $f){
$arr=explode(".",$f['name']);
$ext=$arr[count($arr)-1];
$file_name = randFname($ext);
move_uploaded_file($f['tmp_name'], $file_name);
}
list($width, $height) = getimagesize($file_name);
$newwidth="80";
$newheight="80";
$thumb = imagecreatetruecolor($newwidth, $newheight);
$source = imagecreatefromjpeg($file_name);
imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
imagejpeg($thumb);
echo "התמונות הועלו בהצלחה!";
?>
הוא רושם לי ת'שגיאה הבאה:
קוד:
Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 8192 bytes) in /home/idan/domains/mydomain.net/public_html/ido/admin/upload.php on line 28
את התמונה הוא מעלה אבל הוא לא מקטין אותה
צריך לתת הרשאות לתמונה?
אם כן תוכלו להביא לי ת'קוד?
תודה לעוזרים