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.