Properties

$upload_temp

$upload_temp : 

Type

$upload_baseurl

$upload_baseurl : 

Type

$upload_basedir

$upload_basedir : 

Type

Methods

__construct()

__construct() 

Files constructor.

ajax_remove_file()

ajax_remove_file() 

Remove file by AJAX

ajax_resize_image()

ajax_resize_image() 

Resize image AJAX handler

allowed_image_types()

allowed_image_types() : array

Allowed image types

Returns

array

allowed_file_types()

allowed_file_types() : mixed

Allowed file types

Returns

mixed

get_fonticon_by_ext()

get_fonticon_by_ext(  $extension) : string

Get extension icon

Parameters

$extension

Returns

string

get_fonticon_bg_by_ext()

get_fonticon_bg_by_ext(  $extension) : string

Get extension icon background

Parameters

$extension

Returns

string

setup_paths()

setup_paths() 

Setup upload directory

unique_dir()

unique_dir() : mixed

Generate unique temp directory

Returns

mixed

path_only()

path_only(  $file) : string

Get path only without file name

Parameters

$file

Returns

string

fix_image_orientation()

fix_image_orientation(  $rotate,   $source) : resource

Fix image orientation

Parameters

$rotate
$source

Returns

resource

create_and_copy_image()

create_and_copy_image(  $source,   $destination, integer  $quality = 100) : array

Process an image

Parameters

$source
$destination
integer $quality

Returns

array

upload_temp_file()

upload_temp_file(  $source,   $destination) 

Process a file

Parameters

$source
$destination

new_image_upload_temp()

new_image_upload_temp(  $source,   $destination, integer  $quality = 100) : string

Process a temp upload

Parameters

$source
$destination
integer $quality

Returns

string

new_file_upload_temp()

new_file_upload_temp(  $source,   $destination) : string

Process a temp upload for files

Parameters

$source
$destination

Returns

string

make_dir()

make_dir(  $dir) 

Make a Folder

Parameters

$dir

get_extension_by_mime_type()

get_extension_by_mime_type(  $mime) : mixed

Get extension by mime type

Parameters

$mime

Returns

mixed

get_file_data()

get_file_data(  $file) : mixed

Get file data

Parameters

$file

Returns

mixed

get_image_data()

get_image_data(  $file) : mixed

Get image data

Parameters

$file

Returns

mixed

check_image_upload()

check_image_upload(  $file,   $field) : null|string|void

Check image upload and handle errors

Parameters

$file
$field

Returns

null|string|void

check_file_upload()

check_file_upload(  $file,   $extension,   $field) : null|string

Check file upload and handle errors

Parameters

$file
$extension
$field

Returns

null|string

in_array()

in_array(  $value,   $array) : boolean

If a value exists in comma seperated list

Parameters

$value
$array

Returns

boolean

delete_file()

delete_file(  $src) 

This function will delete file upload from server

Parameters

$src

delete_core_user_photo()

delete_core_user_photo(  $user_id,   $type) 

Delete a main user photo

Parameters

$user_id
$type

resize_image()

resize_image(  $file,   $crop) : string

Resize a local image

Parameters

$file
$crop

Returns

string

new_user()

new_user(  $user_id) 

Make a user folder for uploads

Parameters

$user_id

new_user_upload()

new_user_upload(  $user_id,   $source,   $key) : string

New user upload

Parameters

$user_id
$source
$key

Returns

string

remove_dir()

remove_dir(  $dir) 

Remove a directory

Parameters

$dir

format_bytes()

format_bytes(  $size, integer  $precision = 1) : string

Format Bytes

Parameters

$size
integer $precision

Returns

string

ajax_image_upload()

ajax_image_upload() 

Image upload by AJAX

ajax_file_upload()

ajax_file_upload()