Manual:Hooks/UploadVerification
From Linux Web Expert
File:OOjs UI icon alert-destructive.svg | <translate> This feature was removed from MediaWiki core in version <tvar name=ver>1.34.0</tvar> (after being deprecated in <tvar name=4>1.28.0</tvar>).</translate> <translate> Please see <tvar name=page>UploadVerifyFile</tvar> for an alternative way to use this feature.</translate> |
UploadVerification | |
---|---|
<translate> Available from <tvar name=1><translate> version <tvar </tvar></translate> <translate> Removed in <tvar name=1><translate> version <tvar (Gerrit change 520329)</tvar></translate> Called when a file is uploaded, to allow extra layers of verification for a file to take place | |
<translate> Define function:</translate> | public static function onUploadVerification( string $saveName, string $tempName, string &$error ) { ... }
|
<translate> Attach hook:</translate> | <translate> In <tvar name=1>extension.json</tvar>:</translate>
{
"Hooks": {
"UploadVerification": "MediaWiki\\Extension\\MyExtension\\Hooks::onUploadVerification"
}
}
|
<translate> Called from:</translate> | <translate> File(s):</translate> upload/UploadBase.php |
<translate> Interface:</translate> | UploadVerificationHook.php |
<translate> For more information about attaching hooks, see <tvar name=1>Manual:Hooks </tvar>.</translate>
<translate> For examples of extensions using this hook, see <tvar name=cat>Category:UploadVerification extensions</tvar>.</translate>
Details
$saveName
: destination file name (string)$tempName
: filesystem path to the temporary file for checks (string)&$error
: output: HTML error to show if upload canceled by returning false (string)