Update index.js
Browse files
index.js
CHANGED
@@ -30,8 +30,8 @@ app.post('/upload', upload.single('file'), async (req, res) => {
|
|
30 |
const zipBuffer = await zip.generateAsync({ type: 'nodebuffer' });
|
31 |
|
32 |
// 创建包含文件信息的表格图片
|
33 |
-
const width =
|
34 |
-
const height =
|
35 |
const canvas = createCanvas(width, height);
|
36 |
const ctx = canvas.getContext('2d');
|
37 |
|
@@ -44,10 +44,13 @@ app.post('/upload', upload.single('file'), async (req, res) => {
|
|
44 |
ctx.font = '20px Arial';
|
45 |
const text = `
|
46 |
File Name: ${fileName}
|
|
|
47 |
File Type: ${fileType}
|
|
|
48 |
File Size: ${fileBuffer.length} bytes
|
|
|
49 |
Created At: ${new Date().toLocaleString()}
|
50 |
-
|
51 |
`;
|
52 |
ctx.fillText(text.trim(), 50, 100);
|
53 |
|
|
|
30 |
const zipBuffer = await zip.generateAsync({ type: 'nodebuffer' });
|
31 |
|
32 |
// 创建包含文件信息的表格图片
|
33 |
+
const width = 400;
|
34 |
+
const height = 300;
|
35 |
const canvas = createCanvas(width, height);
|
36 |
const ctx = canvas.getContext('2d');
|
37 |
|
|
|
44 |
ctx.font = '20px Arial';
|
45 |
const text = `
|
46 |
File Name: ${fileName}
|
47 |
+
|
48 |
File Type: ${fileType}
|
49 |
+
|
50 |
File Size: ${fileBuffer.length} bytes
|
51 |
+
|
52 |
Created At: ${new Date().toLocaleString()}
|
53 |
+
|
54 |
`;
|
55 |
ctx.fillText(text.trim(), 50, 100);
|
56 |
|