Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
PHP: http_send_file - Manual
[go: Go Back, main page]

downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

http_send_last_modified" width="11" height="7"/> <http_send_data
Last updated: Fri, 27 Aug 2010

view this page in

http_send_file

(PECL pecl_http >= 0.1.0)

http_send_fileファイルを送信する

説明

bool http_send_file ( string $file )

(複数の) range リクエストをサポートするファイルを送信します。

この関数の振る舞いおよびその後の動作は、以下の INI 設定 http.send.not_found_404 そして http.log.not_found に依存します。

INI 設定 http.send.not_found_404 が有効で INI 設定 http.log.not_found が書き込み可能なファイルを指している場合は、file が見つからないときにそこにログメッセージが書き込まれます。

パラメータ

file

送信するファイル。

返り値

成功した場合に TRUE を、失敗した場合に FALSE を返します。

例1 http_send_file() の例

<?php
http_send_content_disposition
("document.pdf"true);
http_send_content_type("application/pdf");
http_throttle(0.12048);
http_send_file("../report.pdf");
?>

上の例の出力は以下となります。

HTTP/1.1 206 Partial Content
X-Powered-By: PHP/5.2.2
Accept-Ranges: bytes
Content-Length: 12345
Content-Range: bytes 0-12344
Content-Type: application/pdf
Content-Disposition: inline; filename="document.pdf"

%PDF...

参考



add a note add a note User Contributed Notes
http_send_file
There are no user contributed notes for this page.

 
show source | credits | sitemap | contact | advertising | mirror sites