472,126 Members | 1,462 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,126 software developers and data experts.

File Upload Max Size

When uploading a file from a form to my server, I get hit by the max file
size exceded error, I have tried setting:

/*** Sets some INI Variables ***/
ini_set("post_max_size", "30M");
ini_set("upload_max_filesize", "30M");
ini_set("memory_limit", -1 );

To bypass them, but this doesn't seem to work, is there another variable
that I am missing? Its on a local machine so i can modify the ini file
directly, but I would prefer not to, since I need to use it on machine where
I dont have access to these settings?

- Alistair
Jul 17 '05 #1
4 44436
On Tue, 12 Apr 2005 23:47:24 +0100, "Alistair Baillie SS2002"
<ab******@cis.strath.ac.uk> wrote:
When uploading a file from a form to my server, I get hit by the max file
size exceded error, I have tried setting:

/*** Sets some INI Variables ***/
ini_set("post_max_size", "30M");
ini_set("upload_max_filesize", "30M");
ini_set("memory_limit", -1 );

To bypass them, but this doesn't seem to work,
post_max_size and upload_max_filesize aren't settable at runtime, because
that's too late. The PHP only runs after the file has been uploaded, i.e. it
can't reach the ini_set until the upload_max_filesize has already been
exceeded. See http://uk.php.net/manual/en/ini.php#ini.list which lists where
each can be changed.

memory_limit can be changed, since you can set it before you use up all the
memory.
is there another variable
that I am missing? Its on a local machine so i can modify the ini file
directly, but I would prefer not to, since I need to use it on machine where
I dont have access to these settings?


You can change these either in the global php.ini file, or per-directory under
Apache using .htaccess files.

--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Jul 17 '05 #2
Thanks, can I ask, how you would set it using .htaccess?

- Alistair

"Andy Hassall" <an**@andyh.co.uk> wrote in message
news:bc********************************@4ax.com...
On Tue, 12 Apr 2005 23:47:24 +0100, "Alistair Baillie SS2002"
<ab******@cis.strath.ac.uk> wrote:
When uploading a file from a form to my server, I get hit by the max file
size exceded error, I have tried setting:

/*** Sets some INI Variables ***/
ini_set("post_max_size", "30M");
ini_set("upload_max_filesize", "30M");
ini_set("memory_limit", -1 );

To bypass them, but this doesn't seem to work,


post_max_size and upload_max_filesize aren't settable at runtime, because
that's too late. The PHP only runs after the file has been uploaded, i.e.
it
can't reach the ini_set until the upload_max_filesize has already been
exceeded. See http://uk.php.net/manual/en/ini.php#ini.list which lists
where
each can be changed.

memory_limit can be changed, since you can set it before you use up all
the
memory.
is there another variable
that I am missing? Its on a local machine so i can modify the ini file
directly, but I would prefer not to, since I need to use it on machine
where
I dont have access to these settings?


You can change these either in the global php.ini file, or per-directory
under
Apache using .htaccess files.

--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool

Jul 17 '05 #3
On Wed, 13 Apr 2005 00:08:27 +0100, "Alistair Baillie SS2002"
<ab******@cis.strath.ac.uk> wrote:
Thanks, can I ask, how you would set it using .htaccess?


http://www.google.com/search?q=php+h...te:www.php.net

--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Jul 17 '05 #4
Thanks for your help
"Andy Hassall" <an**@andyh.co.uk> wrote in message
news:u9********************************@4ax.com...
On Wed, 13 Apr 2005 00:08:27 +0100, "Alistair Baillie SS2002"
<ab******@cis.strath.ac.uk> wrote:
Thanks, can I ask, how you would set it using .htaccess?


http://www.google.com/search?q=php+h...te:www.php.net

--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool

Jul 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Antonio.P | last post: by
1 post views Thread by Ron Vecchi | last post: by
1 post views Thread by Vicky | last post: by
1 post views Thread by Vicky | last post: by
1 post views Thread by BW | last post: by
4 posts views Thread by Jim Michaels | last post: by
6 posts views Thread by rodmc | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.