|
| $max_size = 0 |
|
| $max_width = 0 |
|
| $max_height = 0 |
|
| $max_filename = 0 |
|
| $allowed_types = "" |
|
| $file_temp = "" |
|
| $file_name = "" |
|
| $orig_name = "" |
|
| $file_type = "" |
|
| $file_size = "" |
|
| $file_ext = "" |
|
| $upload_path = "" |
|
| $overwrite = FALSE |
|
| $encrypt_name = FALSE |
|
| $is_image = FALSE |
|
| $image_width = '' |
|
| $image_height = '' |
|
| $image_type = '' |
|
| $image_size_str = '' |
|
| $error_msg = array() |
|
| $mimes = array() |
|
| $remove_spaces = TRUE |
|
| $xss_clean = FALSE |
|
| $temp_prefix = "temp_file_" |
|
| $client_name = '' |
|
|
| $_file_name_override = '' |
|
__construct |
( |
|
$props = array() ) | |
|
File MIME type
Detects the (actual) MIME type of the uploaded file, if possible. The input array is expected to be $_FILES[$field]
- Parameters
-
- Returns
- void
_prep_filename |
( |
|
$filename) | |
|
|
protected |
clean_file_name |
( |
|
$filename) | |
|
Clean the file name for security
- Parameters
-
- Returns
- string
Finalized Data Array
Returns an associative array containing all of the information related to the upload, allowing the developer easy access in one array.
- Returns
- array
display_errors |
( |
|
$open = '<p>' , |
|
|
|
$close = '</p>' |
|
) |
| |
Display the error message
- Parameters
-
- Returns
- string
do_upload |
( |
|
$field = 'userfile' ) | |
|
Perform the file upload
- Returns
- bool
Runs the file through the XSS clean function
This prevents people from embedding malicious code in their files. I'm not sure that it won't negatively affect certain files in unexpected ways, but so far I haven't found that it causes trouble.
- Returns
- void
get_extension |
( |
|
$filename) | |
|
Extract the file extension
- Parameters
-
- Returns
- string
initialize |
( |
|
$config = array() ) | |
|
Initialize preferences
- Parameters
-
- Returns
- void
is_allowed_dimensions |
( |
) | |
|
Verify that the image is within the allowed width/height
- Returns
- bool
Verify that the file is within the allowed size
- Returns
- bool
is_allowed_filetype |
( |
|
$ignore_mime = FALSE ) | |
|
Verify that the filetype is allowed
- Returns
- bool
Validate the image
- Returns
- bool
limit_filename_length |
( |
|
$filename, |
|
|
|
$length |
|
) |
| |
Limit the File Name Length
- Parameters
-
- Returns
- string
List of Mime Types
This is a list of mime types. We use it to validate the "allowed types" set by the developer
- Parameters
-
- Returns
- string
set_allowed_types |
( |
|
$types) | |
|
Set Allowed File Types
- Parameters
-
- Returns
- void
Set an error message
- Parameters
-
- Returns
- void
set_filename |
( |
|
$path, |
|
|
|
$filename |
|
) |
| |
Set the file name
This function takes a filename/path as input and looks for the existence of a file with the same name. If found, it will append a number to the end of the filename to avoid overwriting a pre-existing file.
- Parameters
-
- Returns
- string
set_image_properties |
( |
|
$path = '' ) | |
|
Set Image Properties
Uses GD to determine the width/height/type of image
- Parameters
-
- Returns
- void
Set Maximum File Name Length
- Parameters
-
- Returns
- void
Set Maximum File Size
- Parameters
-
- Returns
- void
Set Maximum Image Height
- Parameters
-
- Returns
- void
Set Maximum Image Width
- Parameters
-
- Returns
- void
Set Upload Path
- Parameters
-
- Returns
- void
set_xss_clean |
( |
|
$flag = FALSE ) | |
|
Set XSS Clean
Enables the XSS flag so that the file that was uploaded will be run through the XSS filter.
- Parameters
-
- Returns
- void
Validate Upload Path
Verifies that it is a valid upload path with proper permissions.
- Returns
- bool
The documentation for this class was generated from the following file:
- system/libraries/Upload.php