43 $upload = $request->getUpload(
'wpUploadFile' );
44 $desiredDestName = $request->getText(
'wpDestFile' );
45 if ( !$desiredDestName ) {
46 $desiredDestName = $upload->getName();
50 $this->
initialize( $desiredDestName, $upload );
59 $this->mUpload = $webRequestUpload;
61 $this->mUpload->getTempName(), $this->mUpload->getSize() );
69 # Allow all requests, even if no file is present, so that an error
70 # because a post_max_size or upload_max_filesize overflow
85 # Check for a post_max_size or upload_max_size overflow, so that a
86 # proper error can be shown to the user
87 if ( $this->mTempPath ===
null || $this->
isEmptyFile() ) {
88 if ( $this->mUpload->isIniSizeOverflow() ) {
93 self::getMaxPhpUploadSize()
99 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)