How to: Upload
This guide details the full flow to upload files using the Frame.io V4 API.
Prerequisites
Before you begin uploading files, ensure you have completed these setup steps:
Frame.io V4 Account
You have a Frame.io V4 account administered via the Adobe Admin Console, OR you have switched to Adobe authentication for your account user
Adobe Developer Console Setup
You have logged into the Adobe Developer Console and have added the Frame.io API to a new or existing project
Authentication Credentials
You have generated the appropriate Authentication credentials for your project
Choosing your upload method
There are two ways to upload a file using the Frame.io API: Create File (local upload)
and Create File (remote upload)
.
Use when the media is locally accessible to your application, similar to dragging a file from your desktop
Use when the media is accessed over the network, such as through an integration with another service
In this guide we’ll start with the simpler case of completing a remote upload.
Remote Upload
To create a file through remote upload, select the Create File (remote upload) endpoint. The request body requires the file name and its source url.
Request Example
Response Example
A successful request will yield a response like the one below:
Local Upload
To create a file through local upload, select the Create File (local upload) endpoint. The request body requires the file name and its file size specified in bytes.
Request Example
Response Example
If the request is successful, a placeholder file resource is created without any content. Depending on the file size, the response body will include one or more upload_urls
. Given this example, we will need to manage this upload in multiple parts.
Important Upload Requirements:
These are important details to keep in mind when sending the subsequent upload request(s):
- The HTTP request method must be
PUT
- The
x-amz-acl
header must be included and be set to private - The
Content-Type
header must match themedia_type
specified in the original Create File (local upload) request. This is true even when uploading the file as separate parts. In the example above, the value formedia_type
isimage/jpeg
. Therefore, the value forContent-Type
must also beimage/jpeg
.
Multi-part Upload
When a given file results in more than one upload url, it may be useful to compose a shell script that splits up the source file into chunks and issues the same number of subsequent requests.
In the sample Python script below, we’re passing in multiple upload urls in the upload_urls
parameter.
Python Implementation Example
Upload Flow Summary
Next Steps: Once your file is uploaded, you can use the returned file ID to add comments, create shares, or perform other operations using the Frame.io V4 API.