Uploading Files
Understand the different methods for uploading files to Vulgate, including single and multipart uploads.
Upload modes
Ingesting files is a two-step process. First, you upload the files, and then start the ingestion process.
Vulgate supports two upload modes: single and multipart.
Single upload
To upload a file at once, follow these two steps:
- Obtain a signed URL for the file upload.
- Make a PUT request to the signed URL with the file content.
Obtaining a signed URL
To obtain a signed URL for the file upload, use the following endpoint:
GET /api/uploads
The following parameters are supported as URL search params:
| Parameter | Type | Default | Description |
|---|---|---|---|
name | string | Required | The name of the file |
type | string | Required | The content type of the file |
For example:
GET /api/uploads?name=example.pdf&type=application/pdf
The response schema is as follows:
{
"url": "https://your-signed-url.com",
"method": "PUT",
"headers": {
"content-type": "application/pdf",
"x-amz-meta-name": "example.pdf"
}
}
Making a PUT request
To upload the file, make a PUT request to the signed URL with the file content. The request should include the headers specified in the response object.
For example:
PUT your-signed-url.com HTTP/1.1
Content-Type: application/pdf
X-Amz-Meta-Name: example.pdf
<file content>
Multipart upload
To upload larger files in multiple parts, follow these steps:
- Initiate a multipart upload
- Make a POST request to the signed URL with the file content.
(To be documented)