Uploading and storing files from the browser (e.g. images) is a common requirement for applications. If you are using a Headless CMS, it might offer file storage built-in. Otherwise, you'll need a file storage provider.
When dealing with large files or images, uploading using a presigned
POST helps shift processing from your server to your provider. For example, you can:
- Create a Serverless Function to return a presigned URL.
- From the front-end, call your Serverless Function to get the presigned
- Allow the user to upload a file on the front-end.
- Forward the file to the
The following guide and project show Next.js applications using presigned URLs to upload images:
For more information on what to do next, we recommend the following articles: