42 $upload = $request->getUpload(
'wpUploadFile' );
43 $desiredDestName = $request->getText(
'wpDestFile' );
44 if ( !$desiredDestName ) {
45 $desiredDestName = $upload->getName();
49 $this->
initialize( $desiredDestName, $upload );
58 $this->mUpload = $webRequestUpload;
60 $this->mUpload->getTempName(), $this->mUpload->getSize() );
68 # Allow all requests, even if no file is present, so that an error
69 # because a post_max_size or upload_max_filesize overflow
84 # Check for a post_max_size or upload_max_size overflow, so that a
85 # proper error can be shown to the user
86 if ( $this->mTempPath ===
null || $this->
isEmptyFile() ) {
87 if ( $this->mUpload->isIniSizeOverflow() ) {
92 self::getMaxPhpUploadSize()
98 return parent::verifyUpload();
UploadBase and subclasses are the backend of MediaWiki's file uploads.
isEmptyFile()
Return true if the file is empty.
initializePathInfo( $name, $tempPath, $fileSize, $removeTempFile=false)
Implements regular file uploads.
initialize( $name, $webRequestUpload)
Initialize from a filename and a MediaWiki\Request\WebRequestUpload.
static isValidRequest( $request)
WebRequestUpload $mUpload
initializeFromRequest(&$request)