if (!\
is_string($destPath) || (!@
mkdir($destPath) && !
is_dir($destPath))) { throw new RuntimeException(sprintf('Could not create temp directory "%s"',
$destPath));
} $this->
getContainer()->
get('shopware.components.stream_protocol_validator'
)->
validate($url);
if (str_contains($url, 'data:image'
)) { return $this->
uploadBase64File($url,
$destPath,
$baseFilename);
} $filename =
$this->
getUniqueFileName($destPath,
$baseFilename);
$filePath =
sprintf('%s/%s',
$destPath,
$filename);
$put_handle =
fopen($filePath, 'wb+'
);
if (!\
is_resource($put_handle)) { throw new Exception(sprintf('Could not open %s for writing',
$filePath));
} $get_handle =
fopen($url, 'rb'
);
if (!\
is_resource($get_handle)) { throw new Exception(sprintf('Could not open %s for reading',
$url));
}