Jump to content

Changing max upload filesize limit


Fmdpa

Recommended Posts

I'm trying to increase the max filesize to almost 7MB.

ini_set( 'upload_max_size' , '7M' );ini_set( 'post_max_size', '9M');

Why isn't this working? I put it at the top of my file, and ini_get() still returned the php.ini defaults. The upload doesn't work above that default 2MB upload limit either.

Link to comment
Share on other sites

max file upload is not changebale at run time..if you have directory based php.in you can set it there..or by the main php.ini editing

Link to comment
Share on other sites

ini_set reffer to the all of settings of php.ini..but all of them are not changeble..some of them has limitation for some security issue...if it was possible to change all in at runtime someone can set the wrong settings at the run time..and can do mischief with the server...i think in this way it preserves the privilage of changing any sensitive settings.if you see at the list of ini directive list..you will see limitation of beside of each settings.here in changble column you will find from where the settings can be changed.

Link to comment
Share on other sites

probably max file upload can be set through .htaccess also..not sure though

Link to comment
Share on other sites

The main reason some settings can't be changed with ini_set() is that the thing that these settings affect occurs before the ini_set() is executed.That's exactly the case with file uploads - PHP first reads the client's HTTP request, which includes the files, places the parsed parts into the superglobals like $_GET, $_POST, and... you guessed it... $_FILES too (after storing the files into the temporary folder up to the limit). Only then is the PHP code executed, including the ini_set().Using any method other than ini_set() will work, since only ini_set() happens after request processing.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...