filespec deprecated
class filespec
deprecated
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|null | $plupload | ||
protected guesser|null | $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 106
__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 124
filespec
set_upload_ary(array $upload_ary)
Set upload ary
at line 179
bool
init_error()
Check if class members were not properly initialised yet
at line 191
filespec
set_error(mixed $error)
Set error in error array
at line 207
clean_filename(string $mode = 'unique', string $prefix = '', string $user_id = '')
Cleans destination filename
at line 255
mixed
get(string $property)
Get property from file object
at line 270
bool
is_image()
Check if file is an image (mime type)
at line 280
bool
is_uploaded()
Check if the file got correctly uploaded
at line 300
remove()
Remove file
at line 315
static string
get_extension(string $filename)
Get file extension
at line 334
string
get_mimetype(string $filename)
Get mime type
at line 356
int
get_filesize(string $filename)
Get file size
at line 369
bool
check_content(array $disallowed_content)
Check the first 256 bytes for forbidden content
at line 406
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 557
bool
additional_checks()
Performing additional checks