phpBB API Documentation
Class

filespec

class filespec

Responsible for holding all file relevant information, as well as doing file-specific operations.

The {@link fileupload fileupload class} can be used to upload several files, each of them being this object to operate further on.

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

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

Cleans destination filename

get($property)

Get property from file object

true is_image()

Check if file is an image (mimetype)

true is_uploaded()

Check if the file got correctly uploaded

remove()

Remove file

get_extension($filename)

Get file extension

get_mimetype($filename)

Get mimetype.

get_filesize($filename)

Get filesize

check_content($disallowed_content)

Check the first 256 bytes for forbidden content

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

additional_checks()

Performing additional checks

Details

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

File Class

Parameters

$upload_ary
$upload_namespace

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

Cleans destination filename

Parameters

$mode
$prefix
$user_id

at line 138
public get($property)

Get property from file object

Parameters

$property

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

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

at line 181
public remove()

Remove file

at line 192
public get_extension($filename)

Get file extension

Parameters

$filename

at line 207
public get_mimetype($filename)

Get mimetype.

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

Parameters

$filename

at line 228
public get_filesize($filename)

Get filesize

Parameters

$filename

at line 237
public check_content($disallowed_content)

Check the first 256 bytes for forbidden content

Parameters

$disallowed_content

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

at line 409
public additional_checks()

Performing additional checks