Question

Prevent Download of DO Spaces Files

Is it possible to prevent direct download to images and videos in Spaces? I have added a policy to prevent direct browser access to images but it’s not a bullet proof way to prevent downloads like saving the webpage or through sources panel in chrome.

We allow streaming and viewing of images but we want to prevent downloading.


Submit an answer
Answer a question...

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!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
September 7, 2022

Hi there,

One way to do this would be to make the objects private in Spaces and then use a pre-signed URL to access the file.

For example, if you are using Laravel you could do that with “Temporary URLs” as described here in the docs:

https://laravel.com/docs/9.x/filesystem#file-urls

This should be supported for other major frameworks too.

If you want to see natively supported by Spaces, the best thing to do to get your voice heard regarding this would be to head over to our Product Ideas board and post a new idea, including as much information as possible for what you’d like to see implemented.

https://ideas.digitalocean.com/

Hope that helps!

- Bobby.