Update index.js
Browse files
index.js
CHANGED
@@ -91,15 +91,16 @@ app.post('/upload', upload.single('file'), async (req, res) => {
|
|
91 |
ctx.font = '20px WenQuanYi Zen Hei';
|
92 |
|
93 |
const text = `
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
|
|
99 |
|
100 |
-
`;
|
101 |
ctx.fillText(text.trim(), 10, 100);
|
102 |
const rawImageData = canvas.toBuffer('image/jpeg', { quality: 0.75 });
|
|
|
103 |
const finalBuffer = Buffer.concat([rawImageData, zipBuffer]);
|
104 |
const outputFileName = encodeURIComponent(fileName.replace(/\.[^/.]+$/, "") + '-pic.zip.jpg');
|
105 |
|
|
|
91 |
ctx.font = '20px WenQuanYi Zen Hei';
|
92 |
|
93 |
const text = `
|
94 |
+
File Name: ${fileName}
|
95 |
+
File Type: ${fileType}
|
96 |
+
File Size: ${fileBuffer.length} bytes
|
97 |
+
Created At: ${new Date().toLocaleString('zh-CN', { timeZone: 'Asia/Shanghai' })}
|
98 |
+
Created By: ${hostname}
|
99 |
+
`;
|
100 |
|
|
|
101 |
ctx.fillText(text.trim(), 10, 100);
|
102 |
const rawImageData = canvas.toBuffer('image/jpeg', { quality: 0.75 });
|
103 |
+
|
104 |
const finalBuffer = Buffer.concat([rawImageData, zipBuffer]);
|
105 |
const outputFileName = encodeURIComponent(fileName.replace(/\.[^/.]+$/, "") + '-pic.zip.jpg');
|
106 |
|