ID: 17606
Updated by: luimarma@iti.upv.es
Reported By: luimarma@iti.upv.es
Status: Bogus
Bug Type: HTTP related
Operating System: RedHat 7.3
PHP Version: 4.2.1
New Comment:
A more detailed study of the problem led me to
the next results.
Regardless de memory limit parameter the
file completelly uploads.
It writes the file to the temp dir at disk
as it loads the whole file into memory.
I can accept that this is a known behaviour but I
dont think that this is a good method if one is
willing to implement a php-web based software
repository. So the question is the following.
Is there any cons about just writting the file in
the tmp dir instead than duplicating the task
into memory?
Please, answer the question as I am evauating to
do the hack myself.
Thanks,
Luis
Previous Comments:
------------------------------------------------------------------------
[2002-06-06 04:22:28] sander@php.net
Yeah, this is known behaviour. PHP reads the whole uploaded file into
memory before writing it to disk. Not a bug.
------------------------------------------------------------------------
[2002-06-05 07:55:28] luimarma@iti.upv.es
The first problem was solved (now memory_limit is
used) as it was a configuration problem.
The second problem still stays. The upload eats
system memory until memory_limit. If I am using a
tmp dir why does this happen?
------------------------------------------------------------------------
[2002-06-05 07:09:49] luimarma@iti.upv.es
Upload fails regardless the value of memory_limit
value.
I am using the following values for post
file uploading:
memory_limit = 10M
post_max_size = 10M
file_uploads = On
upload_max_filesize = 10M
allow_url_fopen = On
Uploading anything bigger than a pair of
megs fails
I have also tried with php-4.1.2-7 but then
I could only upload till memory_limit value, and
the upload tmp dir is only used when the whole
file is in memory, so I can only upload files up
to the amount of memory y have in the system.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=17606&edit=1