|
@@ -2217,17 +2217,17 @@ module.exports = app => {
|
|
|
const userAgent = (ctx.request.header['user-agent'] || '').toLowerCase();
|
|
|
let disposition = '';
|
|
|
if (userAgent.indexOf('msie') >= 0 || userAgent.indexOf('chrome') >= 0) {
|
|
|
- disposition = 'attachment; filename=' + encodeURIComponent(fileInfo.file_name);
|
|
|
+ disposition = 'attachment; filename=' + encodeURIComponent(fileInfo.filename);
|
|
|
} else if (userAgent.indexOf('firefox') >= 0) {
|
|
|
- disposition = 'attachment; filename*="utf8\'\'' + encodeURIComponent(fileInfo.file_name) + '"';
|
|
|
+ disposition = 'attachment; filename*="utf8\'\'' + encodeURIComponent(fileInfo.filename) + '"';
|
|
|
} else {
|
|
|
/* safari等其他非主流浏览器只能自求多福了 */
|
|
|
- disposition = 'attachment; filename=' + new Buffer(fileInfo.file_name).toString('binary');
|
|
|
+ disposition = 'attachment; filename=' + new Buffer(fileInfo.filename).toString('binary');
|
|
|
}
|
|
|
ctx.response.set({
|
|
|
'Content-Type': 'application/octet-stream',
|
|
|
'Content-Disposition': disposition,
|
|
|
- 'Content-Length': fileInfo.file_size,
|
|
|
+ 'Content-Length': fileInfo.filesize,
|
|
|
});
|
|
|
// ctx.body = await fs.createReadStream(fileName);
|
|
|
ctx.body = await ctx.helper.ossFileGet(fileInfo.filepath);
|
|
@@ -2659,6 +2659,7 @@ module.exports = app => {
|
|
|
tid: ctx.tender.id,
|
|
|
caid: ctx.change.id,
|
|
|
uid: ctx.session.sessionUser.accountId,
|
|
|
+ type: parts.field.type,
|
|
|
filename: file.name,
|
|
|
fileext: file.ext,
|
|
|
filesize: ctx.helper.bytesToSize(idx === 'isString' ? parts.field.size : parts.field.size[idx]),
|
|
@@ -2721,17 +2722,17 @@ module.exports = app => {
|
|
|
const userAgent = (ctx.request.header['user-agent'] || '').toLowerCase();
|
|
|
let disposition = '';
|
|
|
if (userAgent.indexOf('msie') >= 0 || userAgent.indexOf('chrome') >= 0) {
|
|
|
- disposition = 'attachment; filename=' + encodeURIComponent(fileInfo.file_name);
|
|
|
+ disposition = 'attachment; filename=' + encodeURIComponent(fileInfo.filename);
|
|
|
} else if (userAgent.indexOf('firefox') >= 0) {
|
|
|
- disposition = 'attachment; filename*="utf8\'\'' + encodeURIComponent(fileInfo.file_name) + '"';
|
|
|
+ disposition = 'attachment; filename*="utf8\'\'' + encodeURIComponent(fileInfo.filename) + '"';
|
|
|
} else {
|
|
|
/* safari等其他非主流浏览器只能自求多福了 */
|
|
|
- disposition = 'attachment; filename=' + new Buffer(fileInfo.file_name).toString('binary');
|
|
|
+ disposition = 'attachment; filename=' + new Buffer(fileInfo.filename).toString('binary');
|
|
|
}
|
|
|
ctx.response.set({
|
|
|
'Content-Type': 'application/octet-stream',
|
|
|
'Content-Disposition': disposition,
|
|
|
- 'Content-Length': fileInfo.file_size,
|
|
|
+ 'Content-Length': fileInfo.filesize,
|
|
|
});
|
|
|
// ctx.body = await fs.createReadStream(fileName);
|
|
|
ctx.body = await ctx.helper.ossFileGet(fileInfo.filepath);
|