Re: why isn't this working? (many questions inside)
| From: | Dennis Moore | Date: | Tue, 29 Jan 2002 03:29:20 +0000 |
| Subject: | Re: why isn't this working? (many questions inside) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-82509@lists.php.net to get a copy of this message | ||
Just curious, why not use FTP for such a large file?
/dkm
----- Original Message -----
From: "Wei Weng" <wweng@kencast.com>
To: <php-general@lists.php.net>
Sent: Monday, January 28, 2002 8:39 PM
Subject: [PHP] why isn't this working? (many questions inside)
> First, I am running (currently) php 4.0.6 under Redhat 7.2 with kernel
> 2.4.10
>
> I know you can do the following:
>
> <?
>
> header("Content-type: application/force-download");
> header("Content-disposition: attachment; filename=blah.txt");
> readfile("blah.txt");
>
> ?>
>
> to force the user to download a file.
>
> However, this wouldn't work if blah.txt is larger than 2G on my machine
> with php 4.0.6 for Redhat 7.2, because all the file I/O operations are
> done in 32 bits functions.
>
> So here are two solutions i though about:
>
> 1) instead of readfile("blah.txt"), do a passthru("cat blah.txt"). Since
> the basic idea of forcing a download is to pipe the file content to the
> standard output (which is the browser in this case), i don't understand
> why passthru("cat blah.txt") wouldn't do the trick. In fact, I can only
> download about 88Mbs of the whole 4G file I planned to download.
>
> 2) recompile the php package with -D_FILE_OFFSET_BITS=64 enabled. However,
> with the ./configure; make; make install, i can't seem to figure out where
> to stick the option in. (prefer doing it in one of the configure arguments
> if possible)
>
> Forgive me if I posted this to the wrong mailing list, I had been losing
> hairs over these puzzled questions.
>
> TIA.
>
> --
> Wei Weng
> Network Software Engineer
> KenCast Inc.
>
>
> --
> 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
>