By Erdem Koc
Hello, is it posssible to allow access to files from only my website and not directly?
For example when someone type https://cdn.example.com/image.png
from their browser they shouldn’t have access this file but when I put <img src="https://cdn.example.com/image.png"
in my website it should have accessible. Is this possible?
I ask this because I plan to serve large zip files on my CDN, and if these files are accessible to everyone who has a link to them, they can be published on other sites and my bandwidth can fill up quickly. How do I ensure that these files are only downloaded from my site?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Accepted Answer
Heya,
This definitely sounds doable. I believe one way to achieve this will be using a pre-signed URLs.
A pre-signed URL is a connection URL created by an authorised user so that unauthorized users can access restricted resources without sharing credentials.
You can find more information here:
https://docs.digitalocean.com/glossary/pre-signed-url/
Regards
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.