filespec
class filespec
Responsible for holding all file relevant information, as well as doing file-specific operations.
The fileupload fileupload class can be used to upload several files, each of them being this object to operate further on.
Properties
protected string | $filename | ||
protected string | $realname | ||
protected string | $uploadname | ||
protected string | $mimetype | ||
protected string | $extension | ||
protected int | $filesize | ||
protected int | $width | ||
protected int | $height | ||
protected array | $image_info | ||
protected string | $destination_file | ||
protected string | $destination_path | ||
protected bool | $file_moved | ||
protected bool | $local | ||
protected bool | $class_initialized | ||
array | $error | ||
upload | $upload | ||
protected filesystem_interface | $filesystem | ||
protected IniGetWrapper | $php_ini | ||
protected FastImageSize | $imagesize | ||
protected language | $language | ||
protected string | $phpbb_root_path | ||
protected plupload | $plupload | ||
protected guesser | $mimetype_guesser |
Methods
File upload class
Set upload ary
Check if class members were not properly initialised yet
Cleans destination filename
Get property from file object
Check if file is an image (mime type)
Check if the file got correctly uploaded
Remove file
Get file extension
Get mime type
Get file size
Check the first 256 bytes for forbidden content
Move file to destination folder The phpbb_root_path variable will be applied to the destination path
Performing additional checks
Details
at line 104
__construct(filesystem_interface $phpbb_filesystem, language $language, IniGetWrapper $php_ini, FastImageSize $imagesize, string $phpbb_root_path, guesser $mimetype_guesser = null, plupload $plupload = null)
File upload class
at line 122
filespec
set_upload_ary(array $upload_ary)
Set upload ary
at line 177
bool
init_error()
Check if class members were not properly initialised yet
at line 189
filespec
set_error(mixed $error)
Set error in error array
at line 205
clean_filename(string $mode = 'unique', string $prefix = '', string $user_id = '')
Cleans destination filename
at line 253
mixed
get(string $property)
Get property from file object
at line 268
bool
is_image()
Check if file is an image (mime type)
at line 278
bool
is_uploaded()
Check if the file got correctly uploaded
at line 298
remove()
Remove file
at line 313
static string
get_extension(string $filename)
Get file extension
at line 332
string
get_mimetype(string $filename)
Get mime type
at line 354
int
get_filesize(string $filename)
Get file size
at line 367
bool
check_content(array $disallowed_content)
Check the first 256 bytes for forbidden content
at line 404
bool
move_file(string $destination, bool $overwrite = false, bool $skip_image_check = false, string|bool $chmod = false)
Move file to destination folder The phpbb_root_path variable will be applied to the destination path
at line 555
bool
additional_checks()
Performing additional checks