By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,607 Members | 1,806 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,607 IT Pros & Developers. It's quick & easy.

File Upload Max Size

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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.