Next.js Server Actions File Upload Limit Drops B2B Qualification Forms
Published November 27, 2026 · Last reviewed November 27, 2026

Moving qualification funnels off third-party builders and onto custom Next.js stacks solves attribution loss and styling constraints. Operators replacing embedded forms with native code often miss a critical infrastructure constraint. When a high-intent prospect attempts to upload an RFP document, a system architecture diagram, or a historical data CSV, the submission can fail silently. The prospect sees a loading state or a generic error, and the sales team receives nothing. This happens because standard form handling routes the file through server infrastructure that restricts payload sizes.
The short answer
The Next.js Server Actions file upload limit is dictated by the hosting provider. On Vercel, serverless functions restrict request payloads to 4.5MB. When a prospect uploads a file larger than this threshold, the server rejects the request with an HTTP 413 Payload Too Large error. To resolve this, developers must stop passing files through the Server Action. Instead, the application should request a presigned URL from a storage provider like AWS S3 or Cloudflare R2, upload the file directly from the browser, and pass only the resulting file URL to the CRM.
Why serverless functions reject large form payloads
Next.js introduced Server Actions to simplify how applications handle form submissions. Instead of building a separate API route, developers write asynchronous functions that execute on the server and call them directly from client-side form components. This architecture works perfectly for text inputs, checkboxes, and standard lead data.
The architecture breaks when forms accept file uploads. When a user submits a form containing a file, the browser encodes the entire payload and sends it to the serverless function executing the Server Action.
If the application is hosted on Vercel, the infrastructure imposes strict limits on these functions. According to the Vercel function limitations documentation, the maximum request body size for a serverless function is 4.5MB. This limit is hardcoded at the platform level to prevent abuse and ensure fast execution times across the serverless edge network.
In a B2B context, 4.5MB is an exceptionally low ceiling. A standard PDF slide deck, a short screen recording of a software bug, or an uncompressed CSV export from a CRM will easily exceed this limit. When the payload crosses the 4.5MB threshold, the Vercel routing layer intercepts the request before it ever reaches the Next.js application code. The server returns an HTTP 413 Payload Too Large error. Because the error occurs outside the application logic, standard error handling blocks within the Server Action fail to catch it. The user interface often hangs, and the submission is lost.
What this means if you're running spend
Paid traffic operations rely on predictable conversion tracking and reliable lead routing. When a qualification form drops submissions due to payload limits, the operation suffers from silent data loss that actively degrades campaign performance.
The prospects who take the time to upload detailed documentation are typically your highest-intent buyers. They are providing the exact context your sales team needs to prepare a tailored pitch. When the 413 error blocks their submission, the prospect assumes your system is broken. They rarely attempt to submit the form a second time without the file.
This creates a severe attribution gap. The ad platform registers the click and charges the account. The analytics platform might even register the form initiation. But the CRM receives no record of the lead. Because the conversion pixel never fires, the ad platform receives no positive signal. Over time, algorithmic bidding models learn to stop serving ads to the specific types of users who attempt to upload large files, effectively optimizing your campaigns away from your most qualified prospects.
Furthermore, this issue complicates the migration away from legacy tools. Teams often move to custom Next.js forms to stop third-party form webhook timeouts or to bypass privacy extensions suppressing embedded forms. Trading a webhook timeout for a silent payload error defeats the purpose of the engineering investment.
How to bypass the limit with direct-to-storage uploads
To accept large files reliably, the application must decouple the file upload process from the form submission process. The file should never touch the Next.js serverless function. Instead, the browser must upload the file directly to a cloud storage bucket, and the Server Action should only process the resulting URL.
This requires implementing a presigned URL architecture. Here is the exact sequence required to rebuild the upload flow.
Step 1: Request a presigned URL
When the user selects a file in the browser, the client-side code triggers a lightweight Server Action. This action does not send the file. It sends only the file name, file type, and file size.
The Server Action authenticates the request and communicates with your storage provider to generate a temporary, secure upload link. If you use AWS, the server uses the AWS SDK to generate an Amazon S3 presigned URL. This URL grants the browser permission to upload a specific file to a specific bucket for a limited time, usually five to fifteen minutes.
Step 2: Upload the file from the client
The Server Action returns the presigned URL to the browser. The client-side JavaScript then executes an HTTP PUT request, sending the file directly to the storage bucket.
Because the file travels directly from the user to AWS S3 or Cloudflare R2, it bypasses the Vercel infrastructure entirely. S3 and R2 can handle files up to five terabytes, eliminating the 4.5MB constraint. During this step, the browser can display a progress bar to the user, improving the experience for large uploads.
Step 3: Submit the form data
Once the direct upload completes, the storage provider confirms the file is secure. The client-side code then takes the final URL of the uploaded file, attaches it to the rest of the form data, and submits the complete package to the primary Server Action.
The Server Action receives a payload containing text fields and a simple string URL. This payload is a few kilobytes, well below the 4.5MB limit. The action validates the data, writes the record to the database, and pushes the lead to the CRM with the file URL included as a clickable link for the sales team.
Alternative: Vercel Blob client uploads
For teams heavily invested in the Vercel ecosystem, managing AWS IAM roles for S3 can introduce unwanted complexity. Vercel offers a native storage solution called Vercel Blob that simplifies this pattern.
Using the @vercel/blob client upload feature, developers can achieve the same direct-to-storage architecture. The package handles the token generation and client-side uploading automatically, keeping the entire payload out of the serverless function execution while maintaining strict security controls over who can upload files.
Implementing security controls on direct uploads
Moving uploads to the client side requires strict validation to prevent malicious actors from filling your storage buckets with garbage data or executing cross-site scripting attacks.
When generating the presigned URL on the server, you must enforce parameters. The S3 or R2 configuration allows you to dictate the exact MIME types accepted and the maximum file size allowed. If a user attempts to upload an executable file instead of the expected PDF, the storage provider will reject the PUT request at the bucket level.
Additionally, uploaded files should never be served directly back to users on your primary domain. They should be stored in a private bucket. When a sales representative needs to view the RFP, the CRM should route them through an authenticated endpoint that generates a temporary download link, ensuring sensitive prospect data remains secure.
FAQ
Can we increase the Vercel payload limit for Server Actions?
No. The 4.5MB request body limit is a hard platform constraint for serverless functions on Vercel. Upgrading to higher pricing tiers increases execution time limits and memory allocation, but the payload size limit remains fixed across all tiers.
Does this payload limit affect self-hosted Next.js applications?
Self-hosted Next.js applications running on custom Node.js servers or Docker containers do not face the Vercel platform limits. However, standard Node.js body parsers still impose default size restrictions that developers must manually configure to accept large form payloads.
How do we prevent prospects from submitting the form before the large file finishes uploading?
Client-side form components must disable the final submit button while the direct-to-storage upload is in progress. The application state should track the upload status and only release the submission lock once the storage provider returns a successful HTTP 200 response.
Can we scan direct client uploads for malware?
Yes. Because the files land directly in an S3 or R2 bucket, operators can configure cloud functions (like AWS Lambda) to trigger automatically upon object creation. These functions scan the file using antivirus definitions and quarantine infected documents before the sales team can download them from the CRM.
How much of this applies to your operation?
Your technical requirements depend entirely on the complexity of your qualification process. If your funnels only collect names, emails, and company sizes, standard Next.js Server Actions will handle your volume without issue. If your sales motion requires prospects to provide system architecture diagrams, extensive RFPs, or historical performance data, hitting infrastructure payload limits is inevitable.
Fizzi Media builds and rebuilds the technical infrastructure behind high-volume paid traffic operations. We replace failing embedded forms with custom, high-performance web applications that route complex data securely into your CRM. If your current stack is dropping high-intent leads due to technical constraints, we should talk. Explore our approach and apply for a conversation at /apply.
Last reviewed November 27, 2026. Sources linked inline.
Speak directly with Jason, our Managing Director. No sales reps.
