|
@@ -1547,12 +1547,8 @@ module.exports = app => {
|
|
|
'Content-Disposition': disposition,
|
|
|
'Content-Length': size,
|
|
|
});
|
|
|
- // const readStream = fs.readFileSync(path.resolve(this.app.baseDir, zipPath));
|
|
|
- // ctx.body = fs.createReadStream(path.resolve(this.app.baseDir, zipPath));
|
|
|
- ctx.body = fs.readFileSync(path.resolve(this.app.baseDir, zipPath));
|
|
|
- // readStream.on('close', () => {
|
|
|
-
|
|
|
- // });
|
|
|
+ ctx.body = fs.createReadStream(path.join(this.app.baseDir, zipPath));
|
|
|
+ // ctx.body = fs.readFileSync(path.resolve(this.app.baseDir, zipPath));
|
|
|
if (fs.existsSync(path.resolve(this.app.baseDir, zipPath))) {
|
|
|
fs.unlinkSync(path.resolve(this.app.baseDir, zipPath));
|
|
|
}
|