mirror of
https://github.com/standardebooks/web.git
synced 2025-07-12 09:32:24 -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();
|
$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));
|
exec('attr -q -s se-ebook-type -V ' . escapeshellarg($type) . ' ' . escapeshellarg($filePath));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue