rough-rainbow-3431
06/27/2023, 9:14 AM$this->fileSystemService->writeStream($fileSystemStreamTransfer, $stream);
I guess I will have to download temporarily the image and do a kind of fopen to create the $stream argument ?wooden-king-30682
06/27/2023, 10:24 AMwriteStreamrough-rainbow-3431
06/27/2023, 10:56 AMprivate function determineSource($url)
{
// Use the contents of a file as the data source.
if (is_string($url)) {
$source= Psr7\Utils::tryFopen($url, 'r');
}
// Create a source stream.
// $stream = Psr7\Utils::streamFor($source);
// if (!$stream->isReadable()) {
// throw new IAE('Source stream must be readable.');
// }
return $source;
}
$stream = $this->determineSource($url);
// Upload file
$this->fileSystemService->writeStream($fileSystemStreamTransfer, $stream);rough-rainbow-3431
06/27/2023, 4:09 PMrough-rainbow-3431
06/27/2023, 4:10 PMrough-rainbow-3431
06/27/2023, 4:25 PM