RE: [PHP-WIN] open/download file not under www-root
| From: | Gustav Wiberg | Date: | Tue, 04 Sep 2007 13:02:00 +0000 |
| Subject: | RE: [PHP-WIN] open/download file not under www-root | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-28424@lists.php.net to get a copy of this message | ||
Hi Stut!
Exactly what does that mean? Do you have any references? Please send :-)
Best regards
/Gustav Wiberg
-----Original Message-----
From: Stut [mailto:stuttle@gmail.com]
Sent: Tuesday, September 04, 2007 2:02 PM
To: trystano@aol.com
Cc: george.pitcher@ingenta.com; gustav@hmn.se; php-windows@lists.php.net
Subject: Re: [PHP-WIN] open/download file not under www-root
trystano@aol.com wrote:
> I thought accessing files/directories above the www-root via the web was impossible???
Directly yes, but you can proxy it through a server-side script.
-Stut
--
http://stut.net/
> -----Original Message-----
> From: George Pitcher <george.pitcher@ingenta.com>
> To: Gustav Wiberg <gustav@hmn.se>; php-windows@lists.php.net
> Sent: Tue, 4 Sep 2007 12.04pm
> Subject: RE: [PHP-WIN] open/download file not under www-root
>
> Gustav,
>
>
>> Windows 2003 Server/PHP 5.0.1
>>
>> Is it possible to download a file from a server that is at for
>> example u:/documents/ which is not under the www-root?
>> How would I reference that file. (I just want to open it -for
>> example a word-file)
>
> Yes, you can. I actually let my [registered] users download files that are
> stored on a different PC to the server. The server pulls the file across and
> provides a header allowing download - mine are all PDFs but I don't see that
> Word files would be a problem - just a different content-type.
>
> I use Apache, but previously used IIS (NT4) without any problem. (I switched
> to Apache to do some extra java stuff that was impossible under IIS.)
>
> My code:
>
> <?php
> $fp=$_POST['fp'];
> $tr_id=$_POST['tr_id'];
> $fpd = "G:\\".$fp.".pdf";
> $len = filesize($fpd);
> header("Content-Type: application/pdf");
> header("Content-Disposition: inline; filename=$fpd");
> header("Content-Title: $fpd");
> header("Content-Length: $len");
> readfile($fpd);
> ?>
>
> Cheers
>
> George
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.485 / Virus Database: 269.13.3/986 - Release Date: 2007-09-03 09:31