Manual:Hooks/UploadVerifyFile

Details

 * : an instance of, with all info about the upload.
 * : the uploaded file's mime type, as detected by MediaWiki. Handlers will typically only apply for specific mime types.
 * : output true if the file is valid. Otherwise, an indexed array representing the problem with the file, where the first element is the message key and the remaining elements are used as parameters to the message.

Example
Limit image size and dimensions for regular images, but bypass that size on webm videos. Note that this code doesn't override the wiki's predefined max upload size. Users with the custom  right will bypass the checks done in this hook.