fix(pdf-compress): stream large uploads via busboy instead of arrayBuffer
req.arrayBuffer() fails with 502 on files >100MB because it tries to buffer the entire body in memory before the route handler runs. New approach: busboy streams the multipart body directly to a temp file on disk — never buffers the whole request in memory. Works for any size. Shared helper: parse-upload.ts (busboy streaming, 500MB limit, fields). Both local (qpdf) and cloud (iLovePDF) routes refactored to use it. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
"@prisma/client": "^6.19.2",
|
||||
"axios": "^1.13.6",
|
||||
"axios-cookiejar-support": "^6.0.5",
|
||||
"busboy": "^1.6.0",
|
||||
"class-variance-authority": "^0.7.1",
|
||||
"clsx": "^2.1.1",
|
||||
"docx": "^9.6.0",
|
||||
@@ -36,6 +37,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tailwindcss/postcss": "^4",
|
||||
"@types/busboy": "^1.5.4",
|
||||
"@types/jszip": "^3.4.0",
|
||||
"@types/node": "^20",
|
||||
"@types/nodemailer": "^7.0.11",
|
||||
|
||||
Reference in New Issue
Block a user