Go to the documentation of this file.
48 $fname, $headers = [], $sendErrors =
true, $optHeaders = [], $flags = 0
51 throw new InvalidArgumentException( __FUNCTION__ .
" given storage path '$fname'." );
57 'obResetFunc' =>
'wfResetOutputBuffers',
58 'streamMimeFunc' => [ __CLASS__,
'contentTypeFromPath' ]
62 return $streamer->stream( $headers, $sendErrors, $optHeaders, $flags );
102 $ext = strrchr( $filename,
'.' );
103 $ext =
$ext ===
false ?
'' : strtolower( substr(
$ext, 1 ) );
105 # trivial detection by file extension,
106 # used for thumbnails (thumb.php)
118 return 'unknown/unknown';
125 $type = $magic->guessTypesForExtension(
$ext );
134 list( , $extList ) = UploadBase::splitExtensions( $filename );
136 return 'unknown/unknown';
141 return 'unknown/unknown';
144 return 'unknown/unknown';
$wgFileBlacklist
Files with these extensions will never be allowed as uploads.
static contentTypeFromPath( $filename, $safe=true)
Determine the file type of a file based on the path.
$wgFileExtensions
This is the list of preferred extensions for uploading files.
$wgMimeTypeBlacklist
Files with these MIME types will never be allowed as uploads if $wgVerifyMimeType is enabled.
$wgStrictFileExtensions
If this is turned off, users may override the warning for files not covered by $wgFileExtensions.
static stream( $fname, $headers=[], $sendErrors=true, $optHeaders=[], $flags=0)
Stream a file to the browser, adding all the headings and fun stuff.
Functions related to the output of file content.
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Throws a warning that $function is deprecated.
static isStoragePath( $path)
Check if a given path is a "mwstore://" path.
static parseRange( $range, $size)
Convert a Range header value to an absolute (start, end) range tuple.
static send404Message( $fname, $flags=0)
Send out a standard 404 message for a file.
Functions related to the output of file content.
static parseRange( $range, $size)
Convert a Range header value to an absolute (start, end) range tuple.
$wgTrivialMimeDetection
Switch for trivial MIME detection.
static send404Message( $fname, $flags=0)
Send out a standard 404 message for a file.
$wgVerifyMimeType
Determines if the MIME type of uploaded files should be checked.
if(!is_readable( $file)) $ext
$wgCheckFileExtensions
This is a flag to determine whether or not to check file extensions on upload.