Bucket url

I currently have public access through custom domain that is able to access my files. For example if someone goes to r2.leaguesounds.com/test.ogg it'll automatically download it. How can i have a url like this for use in an app in an audio src for example, but have it be private so no one can go to that link and download it? Or any recommendations?
3 Replies
Řambo
ŘamboOP2y ago
or for use in an app like that, the file has to be public?
const command = new PutObjectCommand({
Bucket: 'lol-quotes-audio',
Key: key,
Body: body,
ContentType: 'audio/mpeg',
ACL: 'public-read',
});
const command = new PutObjectCommand({
Bucket: 'lol-quotes-audio',
Key: key,
Body: body,
ContentType: 'audio/mpeg',
ACL: 'public-read',
});
also when uploading i put the content type, and it auto downloads the audio file when going to the url instead of having audio play controls on the page opened in incognito browser and doesnt download automatically now 🙂
zegevlier
zegevlier2y ago
The browser needs the file, so there must be some way to download it for the browser. Depending on the context, you could do something like encrypting the file and then decrypting it client-side to make it more difficult to steal them (which is essentially what DRM does), but if someone is determined there will always be a way.
Řambo
ŘamboOP2y ago
i see. thanks
Want results from more Discord servers?
Add your server