在 Apache/PHP 中使用 X-Sendfile [英] Using X-Sendfile with Apache/PHP

查看:24
本文介绍了在 Apache/PHP 中使用 X-Sendfile的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我似乎找不到很多关于 X-Sendfile 的文档或 PHP 示例代码(有一些 Rails 代码).

I can't seem to find much documentation on X-Sendfile or example code for PHP (there is some rails code).

有没有人以前用过它,介意给出一段简短的代码和简短的描述吗?

Anyone used it before and would mind giving a quick snippet of code and a brief description?

推荐答案

X-Sendfile 是一个 HTTP 头,所以你需要这样的东西:

X-Sendfile is an HTTP header, so you want something like this:

header("X-Sendfile: $filename");

如果配置正确,您的网络服务器会接收它.以下是更多详细信息:

Your web server picks it up if correctly configured. Here's some more details:

http://www.jasny.net/articles/how-i-php-x-sendfile/

这篇关于在 Apache/PHP 中使用 X-Sendfile的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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