Manual talk:$wgMaxUploadSize

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)


 * 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)
 * 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)
 * 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 . -- 165.124.111.179 15:47, 1 June 2007 (UTC)

$wgUploadSizeWarning?
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)

Possible Clarification
Currently this variable has no real effect on the size of files that can be uploaded. 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)