class fileupload
File upload class Init class (all parameters optional and able to be set/overwritten separately) - scope is global and valid for all uploads
Properties
| $allowed_extensions | ||
| $disallowed_content | ||
| $max_filesize | ||
| $min_width | ||
| $min_height | ||
| $max_width | ||
| $max_height | ||
| $error_prefix | ||
| int | $upload_timeout |
Methods
|
fileupload(string $error_prefix = '', array $allowed_extensions = false, int $max_filesize = false, int $min_width = false, int $min_height = false, int $max_width = false, int $max_height = false, bool|array $disallowed_content = false)
Init file upload class. |
||
|
reset_vars()
Reset vars |
||
|
set_allowed_extensions($allowed_extensions)
Set allowed extensions |
||
|
set_allowed_dimensions($min_width, $min_height, $max_width, $max_height)
Set allowed dimensions |
||
|
set_max_filesize($max_filesize)
Set maximum allowed filesize |
||
|
set_disallowed_content($disallowed_content)
Set disallowed strings |
||
|
set_error_prefix($error_prefix)
Set error prefix |
||
| object |
form_upload(string $form_name, guesser $mimetype_guesser = null, plupload $plupload = null)
Form upload method Upload file from users harddisk |
|
|
local_upload($source_file, $filedata = false, guesser $mimetype_guesser = null)
Move file from another location to phpBB |
||
| object |
remote_upload(string $upload_url, guesser $mimetype_guesser = null)
Remote upload method Uploads file from given url |
|
|
assign_internal_error($errorcode)
Assign internal error |
||
|
common_checks($file)
Perform common checks |
||
|
valid_extension($file)
Check for allowed extension |
||
|
valid_dimensions($file)
Check for allowed dimension |
||
|
is_valid($form_name)
Check if form upload is valid |
||
|
valid_content($file)
Check for bad content (IE mime-sniffing) |
||
| static array |
image_types()
Get image type/extension mapping |
Details
at line 518
public
fileupload(string $error_prefix = '', array $allowed_extensions = false, int $max_filesize = false, int $min_width = false, int $min_height = false, int $max_width = false, int $max_height = false, bool|array $disallowed_content = false)
Init file upload class.
at line 530
public
reset_vars()
Reset vars
at line 542
public
set_allowed_extensions($allowed_extensions)
Set allowed extensions
at line 553
public
set_allowed_dimensions($min_width, $min_height, $max_width, $max_height)
Set allowed dimensions
at line 564
public
set_max_filesize($max_filesize)
Set maximum allowed filesize
at line 575
public
set_disallowed_content($disallowed_content)
Set disallowed strings
at line 586
public
set_error_prefix($error_prefix)
Set error prefix
at line 602
public object
form_upload(string $form_name, guesser $mimetype_guesser = null, plupload $plupload = null)
Form upload method Upload file from users harddisk
at line 678
public
local_upload($source_file, $filedata = false, guesser $mimetype_guesser = null)
Move file from another location to phpBB
at line 758
public object
remote_upload(string $upload_url, guesser $mimetype_guesser = null)
Remote upload method Uploads file from given url
at line 956
public
assign_internal_error($errorcode)
Assign internal error
at line 1006
public
common_checks($file)
Perform common checks
at line 1040
public
valid_extension($file)
Check for allowed extension
at line 1048
public
valid_dimensions($file)
Check for allowed dimension
at line 1069
public
is_valid($form_name)
Check if form upload is valid
at line 1081
public
valid_content($file)
Check for bad content (IE mime-sniffing)
at line 1091
static public array
image_types()
Get image type/extension mapping