Manual:Hooks/UploadVerification

UploadVerification
Available from version 1.6.0
Removed in version 1.34.0 (Gerrit change 520329)
Called when a file is uploaded, to allow extra layers of verification for a file to take place
Define function:
public static function onUploadVerification( string $saveName, string $tempName, string &$error ) { ... }
Attach hook: In extension.json:
{
	"Hooks": {
		"UploadVerification": "MediaWiki\\Extension\\MyExtension\\Hooks::onUploadVerification"
	}
}
Called from: File(s): upload/UploadBase.php
Interface: UploadVerificationHook.php

For more information about attaching hooks, see Manual:Hooks .
For examples of extensions using this hook, see Category:UploadVerification extensions.


Details edit

  • $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)