代码之家  ›  专栏  ›  技术社区  ›  Julian

在允许flash播放器访问的同时,是否可以使用http\u refer阻止对文件夹的直接访问

  •  0
  • Julian  · 技术社区  · 16 年前

    我的服务器上有mp3文件,我想通过我的网站上的flash播放器访问。有没有可能像一个亲密的同事所建议的那样使用http\u refer来做这件事?

    根据我的研究,我不断遇到下面的代码,但这阻止了一切,包括我的flash播放器。

    < Files *>
    Deny from all
    < /Files>

    1 回复  |  直到 16 年前
        1
  •  1
  •   spender    16 年前

    使用 http_referer

    此外,以下是firefox在Flash请求MP3时发送的头文件:

    GET /music.mp3 HTTP/1.1
    Host: myhost:80
    User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-GB; rv:1.9.2.2) Gecko/20100316 Firefox/3.6.2 GTB7.1 (.NET CLR 3.5.30729)
    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    Accept-Language: en-gb,en;q=0.5
    Accept-Encoding: gzip,deflate
    Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
    Keep-Alive: 115
    Connection: keep-alive