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
| Parameter | Type | Required | Description |
|---|---|---|---|
ctx | context.Context | Yes | Context for cancellation and timeouts |
params.File | param.Field[io.Reader] | No | The file to upload. Must be wrapped with reducto.F[io.Reader]() |
params.Extension | param.Field[string] | No | File extension hint (e.g., βpdfβ). Usually auto-detected from filename |
Returns
*shared.Upload with the following fields:
FileID(string): The file reference to use with other endpoints (format:reducto://...)
Upload Options
From File
The most common way to upload:With Extension Hint
From Buffer/String
File Size Limits
- Direct upload: Up to 100MB
- Presigned URLs: Up to 5GB
Large File Upload Guide
Complete guide to uploading large files using presigned URLs.
Error Handling
- 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
Next Steps
- Learn about parsing documents after upload
- Explore extracting data from uploaded files
- Check out large file uploads for files > 100MB