Real Tech Hacks
Real Tech Hacks

Reputation: 367

How to create a Blob URL to hide original URL Source of the file using java script

I am creating a website where I publish Video files and Pdf files. I need to hide the original URLs of those files while inspecting them. So I want to know how to create Blob URLs using JavaScript.

Upvotes: 1

Views: 1117

Answers (1)

Kaiido
Kaiido

Reputation: 136598

That's useless.

To create a blob: URL, you need a Blob, which is binary data accessible to the browser's memory.
And to have that binary data from the server to the browser's memory, you need to fetch it.

Browsers' dev tools come with a Network monitor, from where all the Network request can be monitored, and the one network request required to fetch the binary data to the browser's memory will be accessible there.

So your evil users willing to steal your files will just have to copy the request from that panel and save the response directly to their disk.

The only sensible way to protect data is through DRMs, for videos see the Encrypted Media Extension API.

Upvotes: 1

Related Questions