Manual:$wgFileExtensions/ko

From Linux Web Expert

<translate> Files and file uploads</translate>: $wgFileExtensions
This is the list of preferred extensions for uploading files. Uploading files with extensions not in this list will trigger a warning.
<translate> Introduced in version:</translate>1.2.0
<translate> Removed in version:</translate><translate> still in use</translate>
<translate> Allowed values:</translate>(array of strings)
<translate> Default value:</translate>see below

자세한 설명

$wgFileExtensions is the list of allowed/preferred extensions for uploading files in LocalSettings.php . It is overridden, however, by $wgProhibitedFileExtensions and $wgMimeTypeExclusions .

If $wgStrictFileExtensions is set to true (default) then this $wgFileExtensions array is the list of allowed extensions, and all others are blocked.

If $wgStrictFileExtensions is set to false then users will only get a warning when uploading files with extensions not in this list. i.e. $wgFileExtensions is then only a preferred set of extensions. In this case some particularly dangerous file extensions will still be blocked using $wgProhibitedFileExtensions and $wgMimeTypeExclusions.

If $wgCheckFileExtensions is false, this option has no effect since all file extensions will be permitted without performing any checks.

If $wgEnableUploads is set to false, this option has no effect since all uploading is disallowed.

Some files, for example OpenDocument files (e.g. used by OpenOffice.org as odt, ods, odg, ...), use MIME types that don't match with their extension (or something similar). Uploading such files results in an error message like The file is corrupt or has an incorrect extension. Please check the file and upload again.. In such cases you can adjust the mapping of file extensions to MIME types, see MIME type validation.

Default values

미디어위키 버전:
<translate> ≥</translate> 1.27
$wgFileExtensions = [ 'png', 'gif', 'jpg', 'jpeg', 'webp', ];
<td class="mw-version-versionbox" title="<translate nowrap> MediaWiki <tvar name=1>1.26</tvar> is unsupported version</translate>">
1.3 – 1.26
<translate> MediaWiki versions:</translate>
$wgFileExtensions = array( 'png', 'gif', 'jpg', 'jpeg' );
<td class="mw-version-versionbox" title="<translate nowrap> MediaWiki <tvar name=1>1.2</tvar> is unsupported version</translate>">
1.2
미디어위키 버전:
$wgFileExtensions = array( "png", "jpg", "jpeg", "ogg" );

예시

$wgFileExtensions is a php array, which is initialised with a default (sensible) set of file extensions. In LocalSettings.php you might use array operations such as...

// Add just one filetype to the default array
$wgFileExtensions[] = 'pdf';

// Add several file types to the default array
$wgFileExtensions = array_merge(
    $wgFileExtensions, [
        'pdf', 'ppt', 'jp2', 'doc', 'docx', 'xls', 'xlsx'
    ]
);

// Override the default with a bundle of filetypes:
// This is usually not a good idea because newer important file extensions could be added in the defaults in later versions of MediaWiki.
$wgFileExtensions = [
    'png', 'gif', 'jpg', 'jpeg', 'jp2', 'webp', 'ppt', 'pdf', 'psd',
    'mp3', 'xls', 'xlsx', 'swf', 'doc', 'docx', 'odt', 'odc', 'odp',
    'odg', 'mpp', 'pptx'
];

같이 보기