How to use presigned uploads?

Feature availability: This feature is not available in the free tier. Consider subscribing to use this feature.
Disclaimer: To be able to provide this feature the file is temporarily stored in our encrypted S3 bucket. After processing it is directly removed.


In many cases, documents are commonly stored in block storages such as AWS S3, Google Cloud Storage, or Dropbox. Our platform simplifies the process of uploading documents to your chosen provider by eliminating the need for sharing or configuring intricate details.

To get started, all you need to do is generate a temporary presigned upload URL with your selected provider and share it with us. From there, we will handle the task of uploading the file directly to your chosen provider after rendering it. We will try to upload the file for 3 times in case of any error, with 3 and 6 seconds delay between those attempts.


Provider Guides

How to upload your documents to AWS S3 buckets?

To upload a document directly to your AWS S3 bucket, use the AWS SDKs to generate a presigned upload URL according to their documentation.

Since our rendering is pretty fast we recommend setting an expiration time of 5 minutes.

import boto3

s3_client = boto3.client("s3")
s3_client.generate_presigned_url(
  ClientMethod="put_object",
  Params={"Bucket": "my-bucket-name", "Key": "my-file.pdf"},
  ExpiresIn=300
)

The resulting url can then be used in the request body.
By default, AWS S3 expects files to be uploaded using the PUT HTTP method when generating a presigned URL, unless configured otherwise.

{
    "template_html": "My beautiful document",
    "presigned_upload": {
      "url": "<PRESIGEND_URL_WITH_CLIENT>",
      "method": "PUT"
    }
}

Additional providers

The presigned upload feature is compatible with various storage providers that allow you to upload files via HTTP method PUT or POST. Some providers like AWS S3 let you choose the HTTP method being used for the upload when generating the presigned URL, it is mandatory that this is also matching the HTTP method passed in the redner request.

  • Google Cloud Storage: Documentation
  • Dropbox: Documentation. The temporary upload links of dropbox require to pass POST as the HTTP method for the upload in the render request.
  • Supabase: Documentation. Select PUT as an HTTP upload method in the request.