JQuery Media Plugin playing file outside the webroot

為{幸葍}努か 提交于 2019-12-13 07:25:31

问题


Is it possible to play a media file which is outside the webroot using the Jquery Media Plugin. The server that we are on is windows based. The file path for example is:

\server\share\music.mp3

In my testing so far it does not seem possible.


回答1:


You won't be able to reference it directly, no. But you could pass it through a local serverside script, making your request-path something like:

getmusic.php?id=music

The getmusic.php script will have access to non-public directories. It can read the mp3 contents, and then spit them back out to the end-user. Be sure to be very skeptical of all requests to this file though, since it opens up the possibility for security-issues.



来源:https://stackoverflow.com/questions/2229963/jquery-media-plugin-playing-file-outside-the-webroot

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