jQuery Media Plugin播放webroot之外的文件 [英] JQuery Media Plugin playing file outside the webroot

查看:171
本文介绍了jQuery Media Plugin播放webroot之外的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用Jquery Media Plugin播放位于Webroot之外的媒体文件。我们所在的服务器是基于Windows的。例如,文件路径是:

\\ share \music.mp3



在我的测试到目前为止似乎不可能。

解决方案

您将无法直接引用它,不。但是你可以通过一个本地的服务器端脚本来传递它,使你的请求路径如下所示:

getmusic.php?id = music $ b $ getmusic.php 脚本可以访问非公共目录。它可以读取mp3的内容,然后把它们吐出来给最终用户。请确保对这个文件的所有请求持怀疑态度,因为这会引发安全问题。

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.

解决方案

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.

这篇关于jQuery Media Plugin播放webroot之外的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆