阻止直接访问文件 (mp3),但允许 Flash 播放器播放歌曲 (htaccess/php)

发布于 2024-09-28 09:02:05 字数 736 浏览 0 评论 0原文

我知道使用各种方法不允许用户下载 mp3 文件实际上是不可能的。但我陷入了这样一种情况,我需要为我的客户让事情变得更加私密/安全。

这是我的问题,我目前正在使用这个 flash mp3 播放器 http://www.flabell.com/flash/Flash-Mp3-Player-29" rel="nofollow">http://www.flabell.com flabell.com/flash/Flash-Mp3-Player-29 流式传输/播放歌曲。播放器使用 xml 进行设置和播放。播放列表。我也在使用 WordPress 和S2Member 插件。

我试图允许播放器播放歌曲,但不允许用户下载/打开文件的直接链接。 (例如:歌曲位于domain.com/player/songs/*.mp3,脚本位于上一级)。是否有 htaccess 方法拒绝直接访问但允许(本地)脚本调用该文件?

另外,我还提到了 WordPress 的 S2Member 插件。

WordPress 插件有一个内置限制,即登录用户可以下载隐藏的开放访问文件。因此,为了下载歌曲,您必须使用domain.com/s2script_download?file=mysong.mp3。

托管文件的文件夹有一个 .htaccess,其中包含“全部拒绝”。是否可以重复使用此文件夹来使用上述 Flash 播放器播放/流式传输歌曲?

I know it's practically impossible to not allow a user to download an mp3 file with all the various methods out there. But I'm stuck in a situation where i need to make things slightly more private/secure for my customers.

Here's my problem, I'm currently using this flash mp3 player http://www.flabell.com/flash/Flash-Mp3-Player-29 to stream/play the songs. The player uses xml for settings & playlist. I'm also using WordPress & the S2Member plugin.

I'm trying to allow the player to play songs but yet do not allow users to download/opening the direct links to the files. (eg: songs are located at domain.com/player/songs/*.mp3, script is in a level up). Is there a htaccess method to deny direct access but yet allow (local) scripts to call the file?

Also, I mentioned about S2Member plugin for WordPress.

The WordPress plugin has a built in restriction to as where logged in users can download files that are hidden from open access. So in order to download a song, u'll have to use domain.com/s2script_download?file=mysong.mp3.

The folder that hosts the files has a .htaccess with a "Deny All" in it. Is it possible to reuse this folder to play/stream songs with the flash player mentioned above?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

最美不过初阳 2024-10-05 09:02:05

据我所知,这是不可能的。是的,可以拒绝对外部世界的访问,同时允许访问本地脚本。但 Flash 不是本地脚本。在所有条件相同的情况下,Flash 应用程序请求文件与浏览器请求文件没有什么不同。您无法在不阻止另一个的情况下阻止其中一个。

我想到的唯一解决方案是让 Flash 应用程序使用特殊的查询字符串(即 /somesong.mp3?fromflash)请求文件。当然,这不会阻止大多数人获得这首歌,但它可能会阻止某些人。

To the best of my knowledge this isn't possible. Yes, it's possible to deny access to the outside world, while allowing access to local scripts. But Flash isn't a local script. All things being equal, a Flash app requesting a file is no different than a browser requesting a file. You can't block one without blocking the other.

The only solution that even comes to my mind is having the Flash app request the file with a special query string, i.e. /somesong.mp3?fromflash. Off course that won't stop most people from getting the song, but it could stop some people.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文