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

search for in the

http_send_last_modified> <http_send_data
Last updated: Fri, 05 Sep 2008

view this page in

http_send_file

(PECL pecl_http:0.1.0-1.5.5)

http_send_fileEnvoi un fichier

Description

bool http_send_file ( string $file )

Envoi un fichier avec le support (multiple) des requêtes.

Le fonctionnement de cette fonction ainsi que ses futures actions dépendent des directive de configuration INIs : http.send.not_found_404 et http.log.not_found.

Si l'directive de configuration INI http.send.not_found_404 est active et l'directive de configuration INI http.log.not_found pointe vers un fichier accessible en écriture, un message sera écrit lorsque le paramètre file n'aura pu être trouvé.

Liste de paramètres

file

le fichier à envoyer

Valeurs de retour

Cette fonction retourne TRUE en cas de succès, FALSE en cas d'échec.

Exemples

Exemple #1 Exemple avec 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");
?>

L'exemple ci-dessus va afficher :

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.

http_send_last_modified> <http_send_data
Last updated: Fri, 05 Sep 2008
 
 
show source | credits | sitemap | contact | advertising | mirror sites