MediaWiki:Gadget-UploadValidation.js

// -- // Force lowercase file extensions // This ensures uploaded files have their extension in lowercase // --

function force_lowercase { $('#mw-upload-form').on('submit', function{		var fileName = $('#wpDestFile').val,		   ext = fileName.substring(fileName.lastIndexOf(".")+1).toLowerCase;		$('#wpDestFile').val( fileName.slice(0, -1*ext.length) + ext );	}); } $( force_lowercase );