php-db | 2001062
Date: 06/21/01
- Next message: Spiro Katerinis: "[PHP-DB] Fatal error: Call to undefined function: mssql_connect()"
- Previous message: Andre P.: "Re: [PHP-DB] How do I backup my MySQL database? asks a Newbie."
- Maybe in reply to: schiarat <email protected>: "[PHP-DB] raw file header in http"
- Next in thread: Andre P.: "Re: [PHP-DB] raw file header in http"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi,
I think you could use something like this
$file_name="/tmp/your_file_name";
Header ( "Content-Type: application/octet-stream");
Header ( "Content-Length: ".filesize($file_name));
Header( "Content-Disposition: inline; filename=$file_name");
readfile($file_name);
If you want instead of using "application/octet-stream" you can can use the
MIME type of the file you are sending for example
"application/x-compressed".
The second and the third headers are optional.
Dobromir VElev
-----Original Message-----
From: schiarat <email protected> <schiarat <email protected>>
To: php-db <email protected> <php-db <email protected>>
Date: Thursday, June 21, 2001 6:03 PM
Subject: [PHP-DB] raw file header in http
I' ve a file in a directory(/tmp) out from http root of web server.
I need to open a page that send this file when it is opened (es.:
opening page.php under netscape it opens a request to save file to
disk, but the "file is out of www root"), i think i t is possible using
command header and a raw http command, but i aven't any idea if it is
possible and if yes in what mode.
The system i use is apache 1.3.9 under redhat linux 7.1,
tank's
Omar
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe <email protected> For additional commands, e-mail: php-db-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe <email protected> For additional commands, e-mail: php-db-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Spiro Katerinis: "[PHP-DB] Fatal error: Call to undefined function: mssql_connect()"
- Previous message: Andre P.: "Re: [PHP-DB] How do I backup my MySQL database? asks a Newbie."
- Maybe in reply to: schiarat <email protected>: "[PHP-DB] raw file header in http"
- Next in thread: Andre P.: "Re: [PHP-DB] raw file header in http"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

