View Single Post

  #3 (permalink)  
Old 04-14-2006
jeanette shakespeare
 
Posts: n/a
Default Re: Directory security

Excellent, cheers



"J2be" <info@nospamj2be.com> wrote in message
news:443efcab$0$36922$4fafbaef@reader3.news.tin.it ...
> Put the folder with pdfs outside the web root folder
> or use a strict .htaccess (deny all)
> and from the php scripts send the data to the client
> with the correct headers
>
> <?php
> $pathtofiles = '/path/to/folder/with/pdfs/';
> $yourfile = 'yourfile.pdf';
> $last_f = $pathtofiles . $yourfile;
> header('Content-Type: application /pdf; name="' . $yourfile . '"');
> header('Content-Transfer-Encoding: binary' );
> header('Content-Length: ' . filesize($last_f) );
> header('Content-Disposition: attachment; filename=" . $yourfile . '"');
> header("Connection: Close");
> readfile($last_f);
>
> ?>
>
> Something like that could be used. to send the file after that you have
> authorized
> the person for the dowload or something else that you want to avoid direct
> linking to the file.
>
> I hope that it's what you need
>
> Regards.
>
>
>
>
> --
> Leonardo Armando Iarrusso - J2Be
> www: http://www.J2be.com - e-mail: info[at]J2Be.com
>
>



Reply With Quote