Class fileupload

Description

File upload class Init class (all parameters optional and able to be set/overwritten separately) - scope is global and valid for all uploads

Located in /includes/functions_upload.php (line 458)


	
			
Variable Summary
Method Summary
 fileupload 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], [ $disallowed_content = false])
 void assign_internal_error ( $errorcode)
 void common_checks ( &$file)
 object form_upload (string $form_name)
 void image_types ()
 void is_valid ( $form_name)
 void local_upload ( $source_file, [ $filedata = false])
 object remote_upload (string $upload_url)
 void reset_vars ()
 void set_allowed_dimensions ( $min_width,  $min_height,  $max_width,  $max_height)
 void set_allowed_extensions ( $allowed_extensions)
 void set_disallowed_content ( $disallowed_content)
 void set_error_prefix ( $error_prefix)
 void set_max_filesize ( $max_filesize)
 void valid_content ( &$file)
 void valid_dimensions ( &$file)
 void valid_extension ( &$file)
Variables
mixed $allowed_extensions = array() (line 460)
mixed $disallowed_content = array() (line 461)
mixed $error_prefix = '' (line 467)
mixed $max_filesize = 0 (line 462)
mixed $max_height = 0 (line 466)
mixed $max_width = 0 (line 465)
mixed $min_height = 0 (line 464)
mixed $min_width = 0 (line 463)
Methods
Constructor fileupload (line 481)

Init file upload class.

fileupload 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], [ $disallowed_content = false])
  • string $error_prefix: Used error messages will get prefixed by this string
  • array $allowed_extensions: Array of allowed extensions, for example array('jpg', 'jpeg', 'gif', 'png')
  • int $max_filesize: Maximum filesize
  • int $min_width: Minimum image width (only checked for images)
  • int $min_height: Minimum image height (only checked for images)
  • int $max_width: Maximum image width (only checked for images)
  • int $max_height: Maximum image height (only checked for images)
  • $disallowed_content
assign_internal_error (line 814)

Assign internal error

  • access: private
void assign_internal_error ( $errorcode)
  • $errorcode
common_checks (line 854)

Perform common checks

void common_checks ( &$file)
  • &$file
form_upload (line 562)

Form upload method Upload file from users harddisk

  • return: Object "filespec" is returned, all further operations can be done with this object
  • access: public
object form_upload (string $form_name)
  • string $form_name: Form name assigned to the file input field (if it is an array, the key has to be specified)
image_types (line 935)

Return image type/extension mapping

void image_types ()
is_valid (line 918)

Check if form upload is valid

void is_valid ( $form_name)
  • $form_name
local_upload (line 616)

Move file from another location to phpBB

void local_upload ( $source_file, [ $filedata = false])
  • $source_file
  • $filedata
remote_upload (line 697)

Remote upload method Uploads file from given url

  • return: Object "filespec" is returned, all further operations can be done with this object
  • access: public
object remote_upload (string $upload_url)
  • string $upload_url: URL pointing to file to upload, for example http://www.foobar.com/example.gif
reset_vars (line 493)

Reset vars

void reset_vars ()
set_allowed_dimensions (line 516)

Set allowed dimensions

void set_allowed_dimensions ( $min_width,  $min_height,  $max_width,  $max_height)
  • $min_width
  • $min_height
  • $max_width
  • $max_height
set_allowed_extensions (line 505)

Set allowed extensions

void set_allowed_extensions ( $allowed_extensions)
  • $allowed_extensions
set_disallowed_content (line 538)

Set disallowed strings

void set_disallowed_content ( $disallowed_content)
  • $disallowed_content
set_error_prefix (line 549)

Set error prefix

void set_error_prefix ( $error_prefix)
  • $error_prefix
set_max_filesize (line 527)

Set maximum allowed filesize

void set_max_filesize ( $max_filesize)
  • $max_filesize
valid_content (line 927)

Check for allowed extension

void valid_content ( &$file)
  • &$file
valid_dimensions (line 897)

Check for allowed dimension

void valid_dimensions ( &$file)
  • &$file
valid_extension (line 889)

Check for allowed extension

void valid_extension ( &$file)
  • &$file

Documentation generated on Tue, 26 Aug 2008 08:34:05 +0200 by phpDocumentor 1.4.2