Update index.js
Browse files
index.js
CHANGED
@@ -101,6 +101,8 @@ app.post('/upload', upload.single('file'), async (req, res) => {
|
|
101 |
res.setHeader('Content-Type', 'image/jpeg');
|
102 |
// 使用 filename* 参数来设置文件名
|
103 |
res.setHeader('Content-Disposition', `attachment; filename*=UTF-8''${outputFileName}`);
|
|
|
|
|
104 |
res.send(finalBuffer);
|
105 |
} catch (error) {
|
106 |
console.error(error);
|
|
|
101 |
res.setHeader('Content-Type', 'image/jpeg');
|
102 |
// 使用 filename* 参数来设置文件名
|
103 |
res.setHeader('Content-Disposition', `attachment; filename*=UTF-8''${outputFileName}`);
|
104 |
+
console.log(`Content-Disposition header is set to: ${res.getHeader('Content-Disposition')}`);
|
105 |
+
|
106 |
res.send(finalBuffer);
|
107 |
} catch (error) {
|
108 |
console.error(error);
|