class upload

Attachment upload class

Properties

protected auth $auth
protected service $cache
protected config $config
protected upload $files_upload
protected language $language
protected guesser $mimetype_guesser
protected dispatcher $phpbb_dispatcher
protected string $phpbb_root_path
protected plupload $plupload
protected user $user

Methods

__construct(auth $auth, service $cache, config $config, upload $files_upload, language $language, guesser $mimetype_guesser, dispatcher $phpbb_dispatcher, plupload $plupload, user $user, $phpbb_root_path)

Constructor for attachments upload class

array
upload(string $form_name, int $forum_id, bool $local = false, string $local_storage = '', bool $is_message = false, array $local_filedata = array())

Upload Attachment - filedata is generated here Uses upload class

array
create_thumbnail()

Create thumbnail for file if necessary

init_files_upload(int $forum_id, bool $is_message)

Init files upload class

check_image(bool $is_image)

Check if uploaded file is really an image

bool
check_attach_quota()

Check if attachment quota was reached

bool
check_disk_space()

Check if there is enough free space available on disk

fill_file_data()

Fills file data with file information and current time as filetime

Details

at line 85
__construct(auth $auth, service $cache, config $config, upload $files_upload, language $language, guesser $mimetype_guesser, dispatcher $phpbb_dispatcher, plupload $plupload, user $user, $phpbb_root_path)

Constructor for attachments upload class

Parameters

auth $auth
service $cache
config $config
upload $files_upload
language $language
guesser $mimetype_guesser
dispatcher $phpbb_dispatcher
plupload $plupload
user $user
$phpbb_root_path

at line 112
array upload(string $form_name, int $forum_id, bool $local = false, string $local_storage = '', bool $is_message = false, array $local_filedata = array())

Upload Attachment - filedata is generated here Uses upload class

Parameters

string $form_name

The form name of the file upload input

int $forum_id

The id of the forum

bool $local

Whether the file is local or not

string $local_storage

The path to the local file

bool $is_message

Whether it is a PM or not

array $local_filedata

An file data object created for the local file

Return Value

array

File data array

at line 214
protected array create_thumbnail()

Create thumbnail for file if necessary

Return Value

array

Updated $filedata

at line 234
protected init_files_upload(int $forum_id, bool $is_message)

Init files upload class

Parameters

int $forum_id

Forum ID

bool $is_message

Whether attachment is inside PM or not

at line 254
protected check_image(bool $is_image)

Check if uploaded file is really an image

Parameters

bool $is_image

Whether file is image

at line 277
protected bool check_attach_quota()

Check if attachment quota was reached

Return Value

bool

False if attachment quota was reached, true if not

at line 300
protected bool check_disk_space()

Check if there is enough free space available on disk

Return Value

bool

True if disk space is available, false if not

at line 330
protected fill_file_data()

Fills file data with file information and current time as filetime