Using php-opencloud, I manage to connect to trigger the download of my images. Large files (20, 30, or 50 GB).
Following the doc, with
$image = $service->getImage($image_id);
$stream = $image->downloadData();
I can see that Psr7 is downloading request body in a temp file /tmp/php...
but I simply can't figure how to redirect the data to store them in a persistent local file.
Using fopen, fwrite I had problem of memory exhaustion and a
$fp = fopen( $local_file, 'w' );
stream_copy_to_stream( $image->downloadData(), $fp );
triggers no error but $local_file is still at 0 bytes at the end.
How can I achieve this ?