More explanatory messages shown when an upload error happens.
authorHuji <huji@users.mediawiki.org>
Thu, 3 Jan 2008 17:37:59 +0000 (17:37 +0000)
committerHuji <huji@users.mediawiki.org>
Thu, 3 Jan 2008 17:37:59 +0000 (17:37 +0000)
includes/SpecialImport.php
languages/messages/MessagesEn.php
maintenance/language/messages.inc

index 64aa4cb..61d7ef7 100644 (file)
@@ -850,7 +850,15 @@ class ImportStreamSource {
                        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 ) ) {
index d5a4c1a..bb3a9fe 100644 (file)
@@ -2301,7 +2301,8 @@ All transwiki import actions are logged at the [[Special:Log/import|import log]]
 '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',
index 61c9180..9091665 100644 (file)
@@ -1553,7 +1553,8 @@ $wgMessageStructure = array(
                'importhistoryconflict',
                'importnosources',
                'importnofile',
-               'importuploaderror',
+               'importuploaderrorsize',
+               'importuploaderrorpartial',
        ),
        'importlog' => array(
                'importlogpage',