return new WikiErrorMsg( 'importnofile' );
}
if( !empty( $upload['error'] ) ) {
- return new WikiErrorMsg( 'importuploaderror', $upload['error'] );
+ switch($upload['error']){
+ case 1: # The uploaded file exceeds the upload_max_filesize directive in php.ini.
+ return new WikiErrorMsg( 'importuploaderror' );
+ case 2: # The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form.
+ return new WikiErrorMsg( 'importuploaderrorsize' );
+ case 3: # The uploaded file was only partially uploaded
+ return new WikiErrorMsg( 'importuploaderrorpartial' );
+ }
+
}
$fname = $upload['tmp_name'];
if( is_uploaded_file( $fname ) ) {
'importhistoryconflict' => 'Conflicting history revision exists (may have imported this page before)',
'importnosources' => 'No transwiki import sources have been defined and direct history uploads are disabled.',
'importnofile' => 'No import file was uploaded.',
-'importuploaderror' => 'Upload of import file failed; perhaps the file is bigger than the allowed upload size.',
+'importuploaderrorsize' => 'Upload of import file failed. The file is bigger than the allowed upload size.',
+'importuploaderrorpartial' => 'Upload of import file failed. The file was only partially uploaded.',
# Import log
'importlogpage' => 'Import log',