Skip to main content

Download multipart file from request

GET 

/v2/endpoints/:endpoint/requests/:requestId/multipart/download

Downloads a file attachment from a multipart/form-data request. This endpoint retrieves the actual file content that was uploaded as part of a request.

Purpose

Use this endpoint to:

  • Retrieve files uploaded via multipart requests
  • Download attachments for inspection or analysis
  • Export uploaded files for testing or compliance
  • Verify file contents match expected uploads

How It Works

When a multipart/form-data request is received by Beeceptor:

  1. File metadata (field name, file name, content type, size) is stored with the request log
  2. File content is stored separately in binary format
  3. The request history shows file metadata but not content (to keep responses manageable)
  4. This endpoint retrieves the actual file content

Required Parameters

Both query parameters are required to identify the specific file:

fieldName: The name of the form field containing the file

  • Must match the name attribute in the multipart form
  • Example: For <input type="file" name="document">, use fieldName=document

component: Where the file was captured

  • Request: File from the incoming client request
  • CalloutRequest: File forwarded to an upstream proxy target

Response

Returns the raw file content with appropriate headers:

  • Content-Type: Original MIME type of the uploaded file
  • Content-Disposition: Attachment with original filename
  • Content-Length: File size in bytes

Finding File Information

To identify which files are available for a request:

  1. Call GET /requests/{requestId} (returns verbose format)
  2. Check request.multipartData array for file metadata
  3. Use fieldName and fileName from the metadata

Limitations

  • Only files (not text fields) can be downloaded
  • File must exist in the request's multipart data
  • Files are retained for the same duration as request history (up to 10 days)
  • Maximum file size depends on subscription plan

Use Cases

  • Debugging File Uploads: Verify uploaded files match expectations
  • Compliance Auditing: Review files submitted through your API
  • Test Verification: Confirm test files were received correctly
  • Data Export: Extract files for external analysis tags: [Request History]

Request

Responses

File downloaded successfully