Skip to main content
The upload method uploads files to Reducto’s servers and returns a file reference that you can use with other endpoints.

Basic Usage


Method Signature

Parameters

Returns

Upload with the following fields:
  • file_id (str): The file reference to use with other endpoints (format: reducto://...)
  • presigned_url (str | None): A presigned URL for the uploaded file (if applicable)

Upload Options

From File Path

The most common way to upload. Use pathlib.Path:

From File Object

From Bytes

When uploading raw bytes, use a tuple to provide filename and content type:

With Extension Override

Use extension when the file type cannot be inferred:

From URL (Presigned URLs)

For large files, you can generate a presigned URL and pass it directly to parse/extract endpoints without uploading:

Async Upload

The async client uses the same interface:

File Size Limits

  • Direct upload: Up to 100MB
  • Presigned URLs: Up to 5GB
For files larger than 100MB, use presigned URLs instead of the upload endpoint.

Large File Upload Guide

Complete guide to uploading large files using presigned URLs.

Supported File Types

The SDK accepts any file type that Reducto supports. Common formats include:
  • Documents: PDF, DOCX, DOC, RTF
  • Images: PNG, JPEG, TIFF, BMP
  • Spreadsheets: XLSX, XLS, CSV
  • Presentations: PPTX, PPT

Supported File Formats

Complete list of supported file formats.

Error Handling

Common errors:
  • File not found: The file path doesn’t exist
  • File too large: File exceeds 100MB limit (use presigned URLs)
  • Invalid file type: File format not supported
  • Network error: Connection issues during upload

Examples

Upload and Parse

Batch Upload

Upload with Extension Override


Best Practices

Use Path Objects

Prefer pathlib.Path over string paths for better cross-platform compatibility.

Handle Large Files

For files > 100MB, use presigned URLs instead of direct upload.

Reuse File IDs

File IDs can be reused across multiple operations without re-uploading.

Error Handling

Always wrap uploads in try/except blocks for production code.

Next Steps