I have a flash player that plays FLV videos and I know that just about every plugin and video grabber can see where the file is coming from, with the exact location.
This has made hotlinking troublesome, let along the downloading of the videos. Is there a way to create a PHP file that loads the file while hiding it’s exact location or address?
Yes, have your PHP file send the appropriate content-type header then readfile() on the FLV file path and it’ll output the contents of the file.
That doesn’t prevent someone from instead grabbing the location of this PHP proxy script. You’ll have to add some extra code there that prevents requests you don’t want to serve. For example, set a token in the user session on the page with the player, and check for that token in your PHP file.
Nothing can actually prevent someone from downloading the video, though. You’ve gotta send them the bits one way or another for them to see the video, so they can capture that data.
It works, streams and all that. But I’ve tested it against some videograbbers and they still see the url to this file, and they show the entire url, like:
Your script is insecure and a real risk to your hosting being compromised
e.g You could likely pass ./etc/passwd to the script and download that (or any other file) on the server. Never pass through unauthenticated input to fread!
Ok. While I don’t show it above, I do have some php coding now that changes up the url to the file to be read, so a person just can’t add a link to a given file and have that be read.
It confirms that a (hidden) directory must exist.
As long as I verify that the link/file is our own, the fread should be fine, right?