You can also do this all in a php file without changing the directives in
either .htaccess or the httpd.conf file.

Here is a sample:

<form enctype="multipart/form-data" action="<? $PHP_SELF ?>" method =
<input tpye = "hidden" name = "MAX_FILE_SIZE" value = "4096"
#1024 each meg :)
<input name="uploadedfile" type="file">
<input type = "submit" value = "Upload">

Hope that helps,
Josh Thomas
RPS Internet Services
-----Original Message-----
From: Oliver Schonrock [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 13, 2002 2:12 PM
Subject: [PHP] File Upload size limit

Sorry for bringing up an old problem, (there seem to be many articles in
the archives already) but I couldn't find the solution there so here is my
version of the problem  ;-)

I am running php 4.2.2 on a virtual host, so I have no access to php.ini.
But I can use the apache directives in .htaccess which has worked well for
me so far. So i have the following directives in the .htaccess in the
directory where the relevant upload script is located:

php_value memory_limit 34M
php_value post_max_size 33M
php_value upload_max_filesize 32M
php_value max_execution_time 600

So I have memory_limit > post_max_size > upload_max_filesize

experimentation shows that uploads greater than 8M bomb out. So I check
phpinfo() and guess what? It reports post_max_size = 8M. The other 3 config
settings have been changed correctly from their master (default) values.
but for some reason the post_max_size 33M has been ignored.

I know that some priviledges are required to be able to change these
settings via .htaccess (namely "AllowOverride Options" or "AllowOverride
All" privileges) but i thought that these applied to all the settings. So
since I can change the first three why not the last one?

Can my host stop me from changing a single config? If so how, and what do
they need to change so I can get post_max_size = 33M?

Or have i missed something really really stupid?

Thanks very much in advance


PHP General Mailing List (
To unsubscribe, visit:

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to