[thelist] PHP force download of file?

Theodore Serbinski stanson at gmail.com
Thu Feb 17 12:03:44 CST 2005

Nice! Yeah that code seems to work great for prompting downloads.

What about uploads though? I have the php.ini max file size set to 2M
and MAX_FILE_SIZE set to 2M as well. If I upload a 3M file, I get
"file too big" error. But if I try to upload a really big file, like
80M in size, it tries to upload, and refreshs page, but no error or
anything. File isn't uploaded as well. Any ideas?


On Thu, 17 Feb 2005 08:44:42 -0800, Ivo P <ipletikosic at gmail.com> wrote:
> This code is part of an app that manages access to ~10,000 internal
> documents for ~2,000 users. Largest file today is 63MB.
> > >
> > > Header( "Content-Type: application/octet-stream" );
> > > Header( "Content-Length:" . filesize( $filepath ) );
> > > Header( "Content-Disposition: attatchment; filename=$filename" );
> > > readfile( $filepath );
> >

More information about the thelist mailing list