Presigned Urls
Presigned Urls to upload files to StorageSync
This step assumes you have followed the installation steps and initialized the client.
Why Presigned Urls?
Very rarely should you allow users to download or upload files from/to your bucket directly. This is because it is a security risk and can lead to malicious users accessing your bucket.
Instead, you should use presigned urls. Presigned urls are valid for a limited time and can be used to download or upload files.
Create a Presigned Url using the StorageSyncClient
The example belows shows how we would create a presigned url for an object called list-of-cats.txt. This assumes the object exists in the root of your bucket.
(Download) Create a Presigned Url using the SDK to Download a file.
Now the url can be used to allow users to download a file.
Check out our guides/examples to see how you could use this url in your application.
(Upload) Create a Presigned Url using the SDK to Upload a file.
Now the url can be used to allow users to upload a file.
Check out our guides/examples to see how you could use this url in your application.