Getting there.
I'm using...
$path = "/home/risk/public_html/$bu/$file";
//Where $bu is the folder name where the file is, I've passed that from 
the previous form, no worries there. I've also passed the file name from 
the previous form, as I have the file type.
    header("Content-Disposition: attachment; filename=$file");
    header("Content-Length: " . filesize($path));
    header("Content-Type: application/$type");
    readfile("$path");

yet when I get this header called, I get prompted to save teh file, all 
good, but I can only save it as an HTML doc, even though in the save 
dialog box, it tells me it's an acrobat fiel (in the case of pdf's etc)
How acn I force it to save as pdf, or zip etc...?






"[EMAIL PROTECTED]" <jabber
27/08/2003 16:53

 
        To:     [EMAIL PROTECTED], [EMAIL PROTECTED]
        cc: 
        Subject:        Re: [PHP] Linking to files outside the directory structure...?


Hello,

This is very much a possibility. first you 'fopen' the file and then you 
do an 'fpassthru' it will send the file to the client. You do need to 
create the correct headers (content-type and content-disposition) to 
match the file type etc.


All the best

[EMAIL PROTECTED] wrote:

>I wanna protect a few files from reandom downloads.
>I'm moving hosts soon, and will loose my mod_auth_mysql module that let 
it 
>talk to the .htaccess file.
>
>What I want to do is store a number of files, outside of my web folder, 
>say one level under it, but still get my browser to retrive that file.
>Perhaps with some coding in PHP?
>
>is this at all possible, or am I barking up the wrong tree...?
>
>Any ideas?
>Tris...
>
>*********************************************************************
>The information contained in this e-mail message is intended only for 
>the personal and confidential use of the recipient(s) named above. 
>If the reader of this message is not the intended recipient or an agent
>responsible for delivering it to the intended recipient, you are hereby 
>notified that you have received this document in error and that any
>review, dissemination, distribution, or copying of this message is 
>strictly prohibited. If you have received this communication in error, 
>please notify us immediately by e-mail, and delete the original message.
>***********************************************************************
>
>
> 
>


-- 
http://www.raditha.com/php/progress.php
A progress bar for PHP file uploads.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





*********************************************************************
The information contained in this e-mail message is intended only for 
the personal and confidential use of the recipient(s) named above.  
If the reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are hereby 
notified that you have received this document in error and that any
review, dissemination, distribution, or copying of this message is 
strictly prohibited. If you have received this communication in error, 
please notify us immediately by e-mail, and delete the original message.
***********************************************************************

Reply via email to