plupload
class plupload
This class handles all server-side plupload functions
Properties
protected string | $phpbb_root_path | ||
protected config | $config | ||
protected request_interface | $request | ||
protected user | $user | ||
protected IniGetWrapper | $php_ini | ||
protected guesser | $mimetype_guesser | ||
protected string | $upload_directory | Final destination for uploaded files, i.e. the "files" directory. |
|
protected string | $temporary_directory | Temporary upload directory for plupload uploads. |
Methods
Constructor.
Plupload allows for chunking so we must check for that and assemble the whole file first before performing any checks on it.
Checks whether the page request was sent by plupload or not
Returns whether the current HTTP request is a multipart request.
Sends an error message back to the client via JSON response
Looks at the list of allowed extensions and generates a string appropriate for use in configuring plupload with
Generates a string that is used to tell plupload to automatically resize files before uploading them.
Checks various php.ini values to determine the maximum chunk size a file should be split into for upload.
No description
Checks whether the chunk we are about to deal with was actually uploaded by PHP and actually exists, if not, it generates an error
Creates the temporary directory if it does not already exist.
Sets the default directories for uploads
Sets the upload directories to the specified paths
Details
at line 73
__construct(string $phpbb_root_path, config $config, request_interface $request, user $user, IniGetWrapper $php_ini, guesser $mimetype_guesser)
Constructor.
at line 95
array|null
handle_upload(string $form_name)
Plupload allows for chunking so we must check for that and assemble the whole file first before performing any checks on it.
at line 155
null
configure(service $cache, template $template, string $s_action, int $forum_id, int $max_files)
Fill in the plupload configuration options in the template
at line 180
bool
is_active()
Checks whether the page request was sent by plupload or not
at line 190
bool
is_multipart()
Returns whether the current HTTP request is a multipart request.
at line 205
null
emit_error(int $code, string $msg)
Sends an error message back to the client via JSON response
at line 227
string
generate_filter_string(service $cache, string $forum_id)
Looks at the list of allowed extensions and generates a string appropriate for use in configuring plupload with
at line 261
string
generate_resize_string()
Generates a string that is used to tell plupload to automatically resize files before uploading them.
at line 293
int
get_chunk_size()
Checks various php.ini values to determine the maximum chunk size a file should be split into for upload.
The intention is to calculate a value which reflects whatever the most restrictive limit is set to. And to then set the chunk size to half that value, to ensure any required transfer overhead and POST data remains well within the limit. Or, if all of the limits are set to unlimited, the chunk size will also be unlimited.
at line 314
protected
temporary_filepath($file_name)
No description
at line 336
protected null
integrate_uploaded_file(string $form_name, int $chunk, string $file_path)
Checks whether the chunk we are about to deal with was actually uploaded by PHP and actually exists, if not, it generates an error
at line 383
protected null
prepare_temporary_directory()
Creates the temporary directory if it does not already exist.
at line 401
protected null
set_default_directories()
Sets the default directories for uploads
at line 415
null
set_upload_directories(string $upload_directory, string $temporary_directory)
Sets the upload directories to the specified paths