packages/docs/docs/editor-starter/asset-uploads.mdx
If the user drops in any image, audio, video or GIF, they are uploaded to cloud storage so that rendering in the cloud can be performed later.
By default, S3 is used for cloud storage, which requires some setup.
[
{
"AllowedHeaders": ["*"],
"AllowedMethods": ["PUT", "GET", "HEAD"],
"AllowedOrigins": ["*"],
"ExposeHeaders": [],
"MaxAgeSeconds": 3000
}
]
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Presign",
"Effect": "Allow",
"Action": ["s3:PutObject", "s3:PutObjectAcl", "s3:DeleteObject"],
"Resource": ["arn:aws:s3:::YOUR_BUCKET_NAME/*"]
}
]
}
:::note
Make sure to replace YOUR_BUCKET_NAME with the name of your bucket.
:::
In your .env file, fill now the following variables:
REMOTION_AWS_ACCESS_KEY_ID=
REMOTION_AWS_SECRET_ACCESS_KEY=
REMOTION_AWS_REGION=
REMOTION_AWS_BUCKET_NAME=
:::note
Rename the .env.example file to .env to get a template.
:::
:::note The same environment variables are also used for rendering in the cloud. :::
Now, restart the Editor Starter.
When you drop in an asset, it should be uploaded to the S3 bucket.
The constant MAX_FILE_UPLOAD_SIZE_IN_MB limits the size of the file that can be uploaded. By default, it is set to 1000MB.
Loading the assets from S3 can be slow.
To speed it up, you can enable Transfer acceleration for your S3 bucket:
Then set the REMOTION_AWS_TRANSFER_ACCELERATION environment variable to true in your .env file.