I have this command:
copy($value['formats']['format'], 'bookData/cover/'.$picturename);
When I open the image from $value['formats']['format']
it is no problem. When I open the image from bookData/cover
, the file must be corrupt. I can't open it with Windows image viewer and I can't open it with Adobe Photoshop.
I have already tried this:
$content = file_get_contents($value['formats']['format'));
$fp = fopen('bookData/cover/'.$picturename, "w");
fwrite($fp, $content);
fclose($fp);
The same result. The server is an Apache with PHP7 on Ubuntu 16.04.