Manual talk:$wgMaxUploadSize

From mediawiki.org
Latest comment: 9 years ago by Bennylin in topic Possible Clarification

hi,

could someone enhance this page?

I just don't understand two things:

  • does this variable intend to limit the size of 1 upload, or the whole directory of upload?
  • what is the type of the value it must be set to? string as "1024 * 1024 * 100"? integer? representing bytes? MO?
This is the maximum size of any single image. It is applied at the time of upload, so lowering this value at a later date won't remove existing files that are now 'too large'. The value is the maximum size of the file in bytes. There are 1024 bytes in a kilobyte, and 1024 kilobytes in a megabyte, so 1024 * 1024 * 100 = 100 megabytes. I will factor this into the page. --HappyDog 17:26, 9 April 2007 (UTC)Reply
  • So I have an issue, and I can't find any help on it at all. I am using Mediawiki 1.8.2
    • In my LocalSettings.php I have $wgMaxUploadSize = 1024*1024*100 #this is equivalent to 100 megs
    • When I try to upload a file that is only 2.5 megs, I get the error...
      • This file is bigger than the server is configured to allow.
    • What am I missing here? --Jakobud 23:47, 29 May 2007 (UTC)Reply
The limitation is not in MediaWiki -- it is in PHP. There is a default upload and post limit of 2MB. See the two links I added to the bottom of the Manual page. -- 165.124.111.179 00:10, 1 June 2007 (UTC)Reply
Also note that you need to make your memory_limit greater than the upload size in php.ini, too. There is yet another a limit imposed in Apache through the LimitRequestBody directive. That may need to change, as well (but it's typically set to unlimited by default). See [1]. -- 165.124.111.179 15:47, 1 June 2007 (UTC)Reply

$wgUploadSizeWarning?[edit]

So this is just the value that will be read as "size shouldn't exceed..." and you can click "Yes, Upload" anyway? So if disabled the warning by $wgUploadSizeWarning = "0"; I don't need to adjust $wgMaxUploadSize but limit the REAL max file size in php.ini as described here? --Subfader 22:06, 12 February 2008 (UTC)Reply

Possible Clarification[edit]

Currently this variable has no real effect on the size of files that can be uploaded.[2] The actual limit is set by the server settings. However a related variable is frequently confused with this one. The $wgUploadSizeWarning variable is what triggers the warning when a large file upload is attempted.

$wgUploadSizeWarning = 1024 * 150;

$wgUploadSizeWarning = 1024 * 1024 * 1;

For example the first setting above would trigger the warning for files over 150KB, and the second would trigger the warning for files over 1MB. As far as I have been able to uncover though there is no actual way to limit file upload sizes other than as a server setting. So although you get a warning, the user can still continue with it if they ignore the warning. On a side note I personally didn't have success with the settings described in the comments above with php.ini, I had to add the following to the httpd.conf file after the module loading section, the file was in the Apache "conf" folder on mine, but might be elsewhere for different setups.

php_value upload_max_filesize "4M"
php_value post_max_size "4M"

That changed the upload file size to 4 megabytes (and changed what is displayed on the file upload page after "Maximum file size: " for me from what was displayed previously.

--Tlosk 17:26, 20 May 2009 (UTC)Reply

Hello i Changed the vlues in my Localsettings file to 10mb size yet, the upload page still show the same mesage of 2mb maximum size? any help?

I am also experiencing the same problem with MediaWiki 1.20 and latest php5. Changed the corresponding 2 entries in php.ini and also added this to my LocalSettings.php. The upload limition (NOT for uploading from URL) is limited up to 8MB, which was the initial value in php.ini. However I have noticed that changing the value of wgMaxUploadSize (and also in php.ini) influences ONLY the upload size limit from URL. If I want to upload a local file the limitation is still present no matter what values I put in the configuration files. I have no idea how to fix this. I read somewhere that restarting the apache-server is needed in order for the new content of php.ini to be noticed but as I wrote before this is definitely not the case. Any help will be appreciated! Rbaleksandar (talk) 18:58, 12 May 2013 (UTC)Reply
I, as well, is experiencing this issue. I have php.ini updated to 12 megs and localsettings. Any advice? I already tried restarting apache. I can get my 2mb limit to go lower but not higher in the upload screen. Any advice?
For those still having the same issue, you need to change the configuration limit of the php in the php.ini file. Bennylin (talk) 12:59, 28 October 2014 (UTC)Reply

Try this[edit]

In your .htaccess file, located in your www directory, try to add this params:

   php_value upload_max_filesize 10M
   php_value post_max_size 10M

With this, I have increased the max file size in mediawiki uploads, and the

$wgMaxUploadSize

param works ok.