I create a zip archive on the server in this way
$zip = new ZipArchive; //создаем архив $zip->open('usr_img/'.$id.'.zip', ZipArchive::CREATE); //создаем архив $img = 'img2.jpg'; //имя файла картинки которой будем добавлять в zip file_put_contents($img, file_get_contents(www.ru/img.jpg)); //скачиваем картинку $zip->addFile($img); //добавляем картинку в zip unlink($img); //удаляем скаченную с др сервера картинку $zip->close(); //сохраняем архив
and add to it a picture from another server. How can I make it so that unlink()
called only when the picture is in the archive, otherwise it is deleted before it gets into the zip
????