[Mediawiki-l] Image Size Limit?

Brion Vibber brion at pobox.com
Wed Mar 31 02:20:11 UTC 2004


On Mar 29, 2004, at 12:29, Dan Carlson wrote:
> Is there a preference where we can enforce the size limit on uploads 
> to the wiki?  Yesterday, I had a newbie who uploaded a 1.2 *megabyte* 
> BMP image to the site.  It would be useful if users were not permitted 
> to override the "recommended" size setting.  Is there a preference 
> where I can set that?

The system-wide PHP settings enforce a strict upload size limit. (The 
default I believe is 2 megabytes.) Or, if you can't change that, you 
can fiddle with the code...

I haven't tested this, but it ought to work. Change:
		if ( ( ! $wpIgnoreWarning ) && ( $wpUploadSize > 150000 ) ) {
			return uploadWarning( WfMsg( "largefile" ) );
		}

to
		if ( $wpUploadSize > 150000 ) {
			return uploadError( WfMsg( "largefile" ) );
		}

Let me know if it does work, I'll poke in another setting for it.

-- brion vibber (brion @ pobox.com)




More information about the MediaWiki-l mailing list