There are two common ways to use storage in Uploadcare. The difference is in flexibility, complexity and the costs of third-party services.
This way is more flexible and requires less settings. Traffic and file storage costs are included in your Uploadcare plan.
If you do not store file in our storage (like in 1st workflow) it is removed after 24 hours. Therefore you should copy all necessary formats soon after uploading.
For this workflow you need to connect custom storage in your dashboard. Traffic and storage costs are not included in your Uploadcare plan and depend on third-party services.
Select your project in Uploadcare dashboard, go to "Custom storage" page. Click "Connect S3 bucket" link to connect new storage to Uploadcare.
Storage is named set of settings. It includes name to identify your custom storage in API, S3 bucket name and prefix. You can use prefix to organize files inside your bucket. It will be added to each file name saved in this storage. You can have as many storages with same bucket and different prefixes as you need.
With temporary link provided by Uploadcare you can copy file to your storage
through api request. In this request,
source should be temporary link and
target is storage name to save file to.
File will be copied to your bucket to path:
<filename> is part of provided link after last slash or original
If file is image you can provide link with operations applied.
In this case modified file name will be made from provided file name
and operations. For example if you pass
source like this:
You will get file at path:
Thus all versions of one file will be stored in the same virtual folder.
Copy method returns link to file with ad hoc scheme
member of response object. For example:
In this scheme host is S3 bucket name and path is path to the file in bucket.
If you want to serve files directly from S3 you can get http link to file by