You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The intermediate files that are downloaded are stored in /tmp, which makes it use a lot of space unnecessarily.
You could add a call to the unlink function to delete the file after use and this would improve a lot and avoid the need to go around deleting temporary files.
....
$tmpfile = tempnam(sys_get_temp_dir(), crc32(time()));
$httpClient->request("GET", (string) $request->getUri(), array(
"synchronous" => true,
"sink" => fopen($tmpfile, "w+")
));
if ($stream = fopen($tmpfile, "r", false, $context)) {
$zip->addFileFromStream($objectName, $stream);
}
unlink($tmpfile); // <-- This line will tell PHP that we no longer need the file.
}
The text was updated successfully, but these errors were encountered:
The intermediate files that are downloaded are stored in
/tmp
, which makes it use a lot of space unnecessarily.You could add a call to the
unlink
function to delete the file after use and this would improve a lot and avoid the need to go around deleting temporary files.In this line:
https://github.com/wgenial/s3-objects-stream-zip-php/blob/master/src/S3ObjectsStreamZip.php#L69
The text was updated successfully, but these errors were encountered: