|
@@ -385,14 +385,11 @@ module.exports = app => {
|
|
|
const filePath = this.app.baseDir + '/app/public/download/';
|
|
|
// console.log('filePath: ' + filePath);
|
|
|
// await this.ctx.helper.recursiveMkdirSync(this.app.baseDir + '/app/public/download');
|
|
|
- const filestream = fs.createReadStream(filePath + uuid + suffix);
|
|
|
- const chunk = await getUuidFile(filestream);
|
|
|
ctx.set({
|
|
|
'Content-Type': 'application/vnd.openxmlformats',
|
|
|
'Content-Disposition': 'attachment; filename="' + rptNameURI + suffix + "\"; filename*=utf-8''" + rptNameURI + suffix,
|
|
|
- 'Content-Length': chunk.length,
|
|
|
});
|
|
|
- ctx.body = chunk;
|
|
|
+ ctx.body = await fs.readFileSync(filePath + uuid + suffix);
|
|
|
} catch (e) {
|
|
|
console.log(e);
|
|
|
}
|