mirror of
https://github.com/standardebooks/web.git
synced 2025-07-10 00:30:28 -04:00
Use copy/unlink instead of rename when generating bulk downloads
This commit is contained in:
parent
bbcdb09945
commit
47a5d3cd02
1 changed files with 4 additions and 1 deletions
|
@ -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));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue