Re: Re[2]: [PHP] MIME type detection on file
| From: | Chris Lee | Date: | Wed, 21 Feb 2001 16:12:58 +0000 |
| Subject: | Re: Re[2]: [PHP] MIME type detection on file | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-40985@lists.php.net to get a copy of this message | ||
<?php
Header("Content-Type: application/pdf ");
Header("Content-Disposition: filename=miningsuplus-search-results.pdf ");
readfile('/tmp/somefile.pdf');
?>
I use this to allow a user to download a pdf, most browser want to view it
in the browser, I wanted them to be able to save the file, not view / run
it. Is this what your looking for ?
--
Chris Lee
Mediawaveonline.com
em. lee@mediawaveonline.com
ph. 250.377.1095
ph. 250.376.2690
fx. 250.554.1120
"Andris Jancevskis" <ajandris@parks.lv> wrote in message
news:95173206838.20010221180429@parks.lv...
> My files are outside web server. These files can not be accessible
> from http://...., but anly user running web pages (nobody or
> IUSR_)
> have access. This limitation is to secure user files.
>
> My primary target is to deliver files to user using web browser. If I
> use require() or insert it is not possible in win32, but if file
> contains valid php code it is *very big* security hole.
>
> How to do this. Mime type tells to browser, wht to do.
> I can only display binary stream like text ...
>
> Could You know, how to send file like .dll, .exe, .php to client
> without executing on server-side?
>
> Andris
> mailto:ajandris@parks.lv
>
> +---------------------------
> Wednesday, February 21, 2001, 5:43:51 PM, you wrote:
>
> > when your uploading a file
>
> No, some of these are uploaded, some not ...
>
> > [lee@server streaming]$ grep "pdf" /etc/mime.types
> > application/pdf pdf
> > [lee@server streaming]$
>
> > If your just curious of what a mime/type is without uploading it (I dont
> > think you are) then youve answered your own question.
>
> > "Files are on local disk. Not accessible from web server. "
>
> > if php can not access the files then how could it possibly ever find
this
> > files mime-type ?
>
> see above ...
>
> Andris
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>