Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

johnDoe220's avatar

How do I secure the link of videos or images (src)?

Hello, I have used signed urls to download and I have done all the security things to the acceptable level, but the problem is that in any case (src) can be displayed and if someone accesses it can download. You may say to use private storage space, but this method has limitations, and one of them is that I cannot show the video and only download is possible, how should I do this, because otherwise all my efforts will be wasted

0 likes
5 replies
Tray2's avatar

Anything that is displayed in the browser can be copied, so there isn't really any way to prevent that from happening. One thing you can do is disable right click using javascript. You can also display images with css instead of using the normal tag.

johnDoe220's avatar

@Tray2 It's true, but even if I disable the right click and even (f12) I can still enter here from another part.

Tray2's avatar

@johnDoe220 I have no ideas on how to prevent files being downloaded, unless you put it behind some kind of paywall.

johnDoe220's avatar

@Tray2 I have done the same thing. This is exactly my problem. If someone has bought the video, then they have access to (src). and can easily share it with others

OussamaMater's avatar

@johnDoe220 I think you want to encrypt your videos, so even if someone downloads it, without the encryption key it's just a garbage file that cannot be played.

This article will get you started understanding the concept:

And it seems to be there's a package that does the job (I have not tried it personally):

Note that 2nd article has a full tutorial on how to use the package to make it impossible to have the videos.

Please or to participate in this conversation.