Use copy/unlink instead of rename when generating bulk downloads

This commit is contained in:
Alex Cabal 2022-07-13 02:44:30 -05:00
parent bbcdb09945
commit 47a5d3cd02

View file

@ -75,7 +75,10 @@ function CreateZip(string $filePath, array $ebooks, string $type, string $webRoo
$zip->close();
rename($tempFilename, $filePath);
// We have to do a copy, then unlink because rename() can't rename across file systems.
// If the bulk downloads are symlinked to a storage volume, the rename() won't work.
copy($tempFilename, $filePath);
unlink($tempFilename);
exec('attr -q -s se-ebook-type -V ' . escapeshellarg($type) . ' ' . escapeshellarg($filePath));
}