fix(pdf-compress): use arrayBuffer() instead of formData() for large files
formData() fails with "Failed to parse body as FormData" on large PDFs in Next.js route handlers. Switch to req.arrayBuffer() which reliably reads the full body, then manually extract the PDF from multipart. Extreme mode: arrayBuffer + multipart extraction + GS + qpdf pipeline. Stirling mode: arrayBuffer forwarding to Stirling with proper headers. Revert serverActions.bodySizeLimit (doesn't apply to route handlers). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2,11 +2,6 @@ import type { NextConfig } from "next";
|
||||
|
||||
const nextConfig: NextConfig = {
|
||||
output: 'standalone',
|
||||
experimental: {
|
||||
serverActions: {
|
||||
bodySizeLimit: '250mb',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export default nextConfig;
|
||||
|
||||
Reference in New Issue
Block a user