Reply to Re: Download problem

Your name:

Reply:


Posted by Rutger Claes on 06/29/05 12:01

Marin wrote:

> Hello,
> I'm using:
> Apache/2.0.54 (Win32) mod_ssl/2.0.54 OpenSSL/0.9.7g PHP/5.0.4
> MySQL 4.1.12
> DocMan1.3RC1 (PHP based document manager)
>
> I'm having following problem: file uploads OK, but problem occurs when I
> try to download or view the file. After some innvestigation, I found out
> that only first 2MB od data is actually downloaded (exactly 2.000.000
> bytes) resulting in corrupted files. (uploaded files are OK!) I couldn't
> find that limit anywhere in my system. If the original filesize is under
> 2M, files are downloaded and/or viewed correctly. Firefox, Opera, IE6 -
> they all behave in the same way. Win98, 2000, XP - the same
>
> If I manualy fetch the files (bypassing DOCman), downloads is OK!
>
> What am I missing here? I'm pretty sure it's PHP related, but I'm running
> out of ideas where to look. Pls. help,
> //Marin

How do you download the file? Do you just go to the file directly, or do
you use something like "getfile.php?id=yourfilehere". If you use the
second method, make shure you don't try to read the file-contents into a
variable before displaying it:

$content = join( "\n", file( $fileLocation ) );

because this will cause errors with the php memory usage. Use fopen and
fread instead to read small pieces and then print them reusing the same
variable.
Or if you use an output buffer, make shure it doesn't grow to big...

If you use the first method... I have no idea.

Rutger
--
Rutger Claes rgc@rgc.tld
Replace tld with top level domain of belgium to contact me pgp:0x3B7D6BD6
Do not reply to the from address. It's read by /dev/null and sa-learn only

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация