mirror of
https://github.com/BobbyWibowo/lolisafe.git
synced 2025-01-31 07:11:33 +00:00
Bypass file if not found when zipping an album
This commit is contained in:
parent
5ff33ba930
commit
149742ab61
@ -152,7 +152,13 @@ albumsController.generateZip = async (req, res, next) => {
|
||||
let archive = new Zip();
|
||||
|
||||
for (let file of files) {
|
||||
archive.file(file.name, fs.readFileSync(path.join(__dirname, '..', config.uploads.folder, file.name)));
|
||||
fs.stat(path.join(__dirname, '..', config.uploads.folder, file.name), (err, stats) => {
|
||||
if (err) {
|
||||
console.log(err);
|
||||
} else {
|
||||
archive.file(file.name, fs.readFileSync(path.join(__dirname, '..', config.uploads.folder, file.name)));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
archive
|
||||
|
Loading…
Reference in New Issue
Block a user