问题
In one of my work i need to build a feature for users to upload videos. i m creating a directory if not exists for that user and storing videos into it. I did directory listing off in .htaccess file so in this case no one can access files listing directly from url.
But when anyone can play that uses video, embed code is generated and in that path is also displayed for that video. When i copy and paste that path in url , video gets downloaded. i want to prevent it from directly accessing? can anyone has a solution for the same?
回答1:
https://tn123.org/mod_xsendfile/
I use this
回答2:
You can store your video files not in DOCUMENT_ROOT directory and provide access through the program.
Something like this: http://test.com/watch.php?video_id=blahblablah , like Youtube
来源:https://stackoverflow.com/questions/7414323/preventing-direct-access-from-url