phpBB API Documentation
Class

fileerror

class fileerror extends filespec

Class for assigning error messages before a real filespec class can be assigned

Properties

$filename
$realname
$uploadname
$mimetype
$extension
$filesize
$width
$height
$image_info
$destination_file
$destination_path
$file_moved
$init_error
$local
$error
$upload

Methods

filespec($upload_ary, $upload_namespace)

File Class

from filespec
clean_filename($mode = 'unique', $prefix = '', $user_id = '')

Cleans destination filename

from filespec
get($property)

Get property from file object

from filespec
true is_image()

Check if file is an image (mimetype)

from filespec
true is_uploaded()

Check if the file got correctly uploaded

from filespec
remove()

Remove file

from filespec
get_extension($filename)

Get file extension

from filespec
get_mimetype($filename)

Get mimetype.

from filespec
get_filesize($filename)

Get filesize

from filespec
check_content($disallowed_content)

Check the first 256 bytes for forbidden content

from filespec
move_file($destination, $overwrite = false, $skip_image_check = false, $chmod = false)

Move file to destination folder The phpbbrootpath variable will be applied to the destination path

from filespec
additional_checks()

Performing additional checks

from filespec
fileerror($error_msg)

Details

in filespec at line 51
public filespec($upload_ary, $upload_namespace)

File Class

Parameters

$upload_ary
$upload_namespace

in filespec at line 93
public clean_filename($mode = 'unique', $prefix = '', $user_id = '')

Cleans destination filename

Parameters

$mode
$prefix
$user_id

in filespec at line 138
public get($property)

Get property from file object

Parameters

$property

in filespec at line 153
public true is_image()

Check if file is an image (mimetype)

Return Value

true if it is an image, false if not

in filespec at line 163
public true is_uploaded()

Check if the file got correctly uploaded

Return Value

true if it is a valid upload, false if not

in filespec at line 181
public remove()

Remove file

in filespec at line 192
public get_extension($filename)

Get file extension

Parameters

$filename

in filespec at line 207
public get_mimetype($filename)

Get mimetype.

Utilize mimecontenttype if the function exist. Not used at the moment...

Parameters

$filename

in filespec at line 228
public get_filesize($filename)

Get filesize

Parameters

$filename

in filespec at line 237
public check_content($disallowed_content)

Check the first 256 bytes for forbidden content

Parameters

$disallowed_content

in filespec at line 271
public move_file($destination, $overwrite = false, $skip_image_check = false, $chmod = false)

Move file to destination folder The phpbbrootpath variable will be applied to the destination path

Parameters

$destination
$overwrite
$skip_image_check
$chmod

in filespec at line 409
public additional_checks()

Performing additional checks

at line 446
public fileerror($error_msg)

Parameters

$error_msg