Error Codes Wiki

HTTP Multipart Upload Errors — File Upload Failures and Size Limits

Warning4xx client error

Overview

Fix HTTP multipart file upload errors including 413 Payload Too Large, boundary parsing failures, timeout errors, and server-side size limit configuration.

Key Details

  • Multipart/form-data is the standard Content-Type for file uploads in HTML forms and APIs
  • Each part is separated by a boundary string defined in the Content-Type header
  • Server rejects uploads exceeding the configured maximum size with 413 Payload Too Large
  • Large file uploads can timeout if the server or proxy connection timeout is too short
  • Chunked transfer encoding can be used for unknown-size uploads but is not universally supported

Common Causes

  • File exceeds server's maximum upload size (client_max_body_size in Nginx, LimitRequestBody in Apache)
  • Missing or incorrect Content-Type: multipart/form-data boundary in the request
  • Connection timeout during large file upload over slow network
  • Proxy or CDN imposing a lower size limit than the backend server
  • Server running out of disk space or temp directory during upload processing

Steps

  1. 1Check the maximum upload size: Nginx default is 1MB (set client_max_body_size), PHP default is 2MB (upload_max_filesize)
  2. 2Increase Nginx: client_max_body_size 100m; and proxy_read_timeout 300s for large uploads
  3. 3For PHP: set upload_max_filesize and post_max_size in php.ini
  4. 4Implement chunked upload for large files: split into parts, upload each, reassemble on server
  5. 5Increase proxy timeout settings: proxy_read_timeout, proxy_send_timeout for large file transfers
  6. 6Monitor server disk space and temp directory permissions

Tags

multipartfile-upload413payload-too-largeupload-size

Related Items

More in 4xx Client Error

Frequently Asked Questions

It varies: Nginx defaults to 1MB, Apache has no default limit, PHP defaults to 2MB, Node.js Express defaults to 100KB for JSON. Always check all layers in your stack.