Re: Delivering NAMED pdf files
| From: | George Pitcher | Date: | Fri, 19 Oct 2001 11:48:29 +0000 |
| Subject: | Re: Delivering NAMED pdf files | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-71584@lists.php.net to get a copy of this message | ||
James,
I can. The text in square brackets is a pdf filename referenced in full from
a Filemaker database using Lasso.
<Form action="fileaccess.php" method="post">
<input type=hidden name="fp" value="[field:'Doc_filename']">
<input type="Submit" value="Download PDF file">
</form>
And the php page which is fileaccess.php:
<?php
$fp1 = "D:\\Pdf\\" . $fp;
$len = filesize($fp1);
header("Content-Type: application/pdf");
header("Content-Disposition: inline; filename=$fp1");
header("Content-Length: $len");
readfile($fp1);
?>
HTH
George
----- Original Message -----
From: "James Cox" <james@wherewithal.com>
To: "George Pitcher" <fmdev@yahoo.co.uk>; "Php-General@Lists. Php. Net"
<php-general@lists.php.net>
Sent: Friday, October 19, 2001 12:45 PM
Subject: RE: [PHP] Delivering NAMED pdf files
> can you paste the full text of the code as you have it? I don't see
anywhere
> where you define the name of the file.
>
> James Cox
>
> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
.
> .
> Politicalia admin and editor
> e: james@politicalia.com :: w: http://www.politicalia.com/
> Today's Discussion, Tomorrow's Agenda.
> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
.
> .
>
>
> > -----Original Message-----
> > From: George Pitcher [mailto:fmdev@yahoo.co.uk]
> > Sent: Friday, October 19, 2001 12:27 PM
> > To: speedboy; php-general@lists.php.net
> > Subject: Re: [PHP] Delivering NAMED pdf files
> >
> >
> > Thanks for the [non] suggestion.
> >
> > I will not host these in a web-accessable directory. They are copyright
> > materials.
> >
> > I've done this type of hosting previously using Frontier on a Mac and it
> > worked fine.
> >
> > I thought that php was better than Frontier, though.
> >
> > George
> > ----- Original Message -----
> > From: "speedboy" <speedboy@nomicrosoft.org>
> > To: <php-general@lists.php.net>
> > Sent: Friday, October 19, 2001 12:27 PM
> > Subject: Re: [PHP] Delivering NAMED pdf files
> >
> >
> > > > Thanks for the suggestion but it didn't change anything.
> > >
> > > It won't. Put them in a web accessible directory and don't use custom
> > header calls because they do not work reliably.
> > >
> > >
> > > --
> > > 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
> >
> >
> > _________________________________________________________
> > Do You Yahoo!?
> > Get your free @yahoo.com address at http://mail.yahoo.com
> >
> >
> > --
> > 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
> >
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com