есть такое: Код (Text): $upfile = '../../../user/media/fotos/photos/'.$new_filename; $img_src = $_FILES["userfile"]["name"]; $width = 120; //Ensure the image exists if(file_exists($img_src)){ //Create image stream $image = imagecreatefromjpeg($img_src); //Gather and store the width and height list($image_width, $image_height) = getimagesize($img_src); //Calculate new height while mantaining apsect ratio $height = (($width / $image_width) * $image_height); //Resample/resize the image $tmp_img = imagecreatetruecolor($width, $height); imagecopyresampled($tmp_img, $image, 0, 0, 0, 0, $width, $height, $image_width, $image_height); imagejpeg($tmp_img, $upfile, 100); //Free memory imagedestroy($tmp_img); imagedestroy($image); } else { echo 'File not found!'; } тут есть условие: if(file_exists($img_src)) это, на сколько я понимаю, оно проверяет существует ли файл? так вот, это условие возвращает ложь почти всегда. у меня только одна фотка загружается. ко всем остальным выводит 'File not found! хотя формат у всех один - jpeg
Верно думаешь, file_exists проверяет наличие файла. А возвращает почти всегда ложь потому, что файл не был найден и менять нечего Попробуй проверить что в переменной $img_src и самостоятельно проверить есть ли в папке ../../../user/media/fotos/photos/'.$new_filename этот файл. Наверняка тут и выяснится в чем трабла(если таковая есть).
в $img_src название файла. и как может находиться в папке ../../../user/media/fotos/photos/'.$new_filename если его там и так нет, он еще не загружен?