class vB_Upload_Userpic extends vB_Upload_Abstract

Properties

array $error Any errors that were encountered during the upload or verification process from vB_Upload_Abstract
vB_Registry $registry Main registry object from vB_Upload_Abstract
vB_Image $image Image object for verifying and resizing from vB_Upload_Abstract
vB_DataManager $upload Object for save/delete operations from vB_Upload_Abstract
array $data Information about the upload that we are working with from vB_Upload_Abstract
array $imginfo Width and Height up Uploaded Image from vB_Upload_Abstract
int $maxuploadsize Maximum size of uploaded file. Set to zero to not check from vB_Upload_Abstract
int $maxwidth Maximum pixel width of uploaded image. Set to zero to not check from vB_Upload_Abstract
int $maxheight Maximum pixel height of uploaded image. Set to zero to not check from vB_Upload_Abstract
array $userinfo Information about user who owns the image being uploaded. Mostly we care about $userinfo['userid'] and $userinfo['attachmentpermissions'] from vB_Upload_Abstract
bool $emptyfile Whether to display an error message if the upload forum is sent in empty or invalid (false = Multiple Upload Forms) from vB_Upload_Abstract
boolean $allowanimation Whether or not animated GIFs are allowed to be uploaded from vB_Upload_Abstract

Methods

__construct($registry)

No description

set_warning()

Set warning

set_error()

Set error state and removes any uploaded file

fetch_error()

Returns the current error

accept_upload(mixed $upload)

This function accepts a file via URL or from $_FILES, verifies it, and places it in a temporary location for processing

fetch_remote_filesize(string $url)

Requests headers of remote file to retrieve size without downloading the file

fetch_best_resize(bool $jpegconvert, bool $resize = true)

Attempt to resize file if the filesize is too large after an initial resize to max dimensions or the file is already within max dimensions but the filesize is too large

process_upload($uploadurl = '')

Verifies a valid remote url for retrieval or verifies a valid uploaded file

save_upload()

Saves a file that has been verified

bool
is_valid_extension(string $extension)

Public Checks if supplied extension can be used

integer
fetch_max_uploadsize(string $extension)

Public Returns the maximum filesize for the specified extension

string
ncrencode_filename($filename)

Public NCR encodes a unicode filename

Details

in vB_Upload_Abstract at line 111
__construct($registry)

Parameters

$registry

in vB_Upload_Abstract at line 126
set_warning()

Set warning

in vB_Upload_Abstract at line 141
set_error()

Set error state and removes any uploaded file

in vB_Upload_Abstract at line 157
fetch_error()

Returns the current error

in vB_Upload_Abstract at line 167
accept_upload(mixed $upload)

This function accepts a file via URL or from $_FILES, verifies it, and places it in a temporary location for processing

Parameters

mixed $upload Valid options are: (a) a URL to a file to retrieve or (b) a pointer to a file in the $_FILES array

in vB_Upload_Abstract at line 383
fetch_remote_filesize(string $url)

Requests headers of remote file to retrieve size without downloading the file

Parameters

string $url URL of remote file to retrieve size from

in vB_Upload_Abstract at line 422
fetch_best_resize(bool $jpegconvert, bool $resize = true)

Attempt to resize file if the filesize is too large after an initial resize to max dimensions or the file is already within max dimensions but the filesize is too large

Parameters

bool $jpegconvert Has the image already been resized once?
bool $resize Attempt a resize

at line 612
process_upload($uploadurl = '')

Verifies a valid remote url for retrieval or verifies a valid uploaded file

Parameters

$uploadurl

at line 720
save_upload()

Saves a file that has been verified

at line 607
bool is_valid_extension(string $extension)

Public Checks if supplied extension can be used

Parameters

string $extension Extension of file

Return Value

bool

at line 602
integer fetch_max_uploadsize(string $extension)

Public Returns the maximum filesize for the specified extension

Parameters

string $extension Extension of file

Return Value

integer

in vB_Upload_Abstract at line 590
string ncrencode_filename($filename)

Public NCR encodes a unicode filename

Parameters

$filename

Return Value

string