php-doc-en/reference/http/functions/responses/http-send-file.xml
Michael Wallner 2a677c5adf - add "see HttpResponse for PHP-5.1+"
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@233345 c90b9560-bf6c-de11-be94-00142212c4b1
2007-04-05 18:16:50 +00:00

157 lines
3.9 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.4 $ -->
<!-- Generated by xml_proto.php v2.4. Found in /scripts directory of phpdoc. -->
<refentry id="function.http-send-file">
<refnamediv>
<refname>http_send_file</refname>
<refpurpose>Send file</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>http_send_file</methodname>
<methodparam><type>string</type><parameter>file</parameter></methodparam>
</methodsynopsis>
<para>
Sends a file with support for (multiple) range requests.
</para>
<para>
This functions behaviour and further action is dependent on the following
&link.http.configuration;s:
<link linkend="http.configuration.send.not_found_404">http.send.not_found_404</link>
&listendand; <link linkend="http.configuration.log.not_found">http.log.not_found</link>.
</para>
<para>
If the &link.http.configuration; <link linkend="http.configuration.send.not_found_404">http.send.not_found_404</link>
is enabled and the &link.http.configuration; <link linkend="http.configuration.log.not_found">http.log.not_found</link>
points to a writable file, a log message is written when the <parameter>file</parameter> was not found.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>file</parameter></term>
<listitem>
<para>
the file to send
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.success;
</para>
</refsect1>
<!-- Use when ERRORS exist
<refsect1 role="errors">
&reftitle.errors;
<para>
When does this function throw E_* level errors, or exceptions?
</para>
</refsect1>
-->
<!-- Use when a CHANGELOG exists
<refsect1 role="changelog">
&reftitle.changelog;
<para>
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>Enter the PHP version of change here</entry>
<entry>Description of change</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</refsect1>
-->
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>A <function>http_send_file</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
http_send_content_disposition("document.pdf", true);
http_send_content_type("application/pdf");
http_throttle(0.1, 2048);
http_send_file("../report.pdf");
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
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...
]]>
</screen>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>http_send_data</function></member>
<member><function>http_send_stream</function></member>
<member><function>http_throttle</function></member>
<member><function>http_send_content_type</function></member>
<member><function>http_send_content_disposition</function></member>
<member>&http.response.class.php51;</member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->