Preventing direct access from url

北城余情 提交于 2020-02-07 07:36:56

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!