Static Public Member Functions |
static | save ($file, $filename=NULL, $directory=NULL, $chmod=0644) |
| Save an uploaded file to a new location.
|
static | valid ($file) |
| Tests if input data is valid file type, even if no upload is present.
|
static | required (array $file) |
| Tests if input data has valid upload data.
|
static | type (array $file, array $allowed_types) |
| Validation rule to test if an uploaded file is allowed by extension.
|
static | size (array $file, array $size) |
| Validation rule to test if an uploaded file is allowed by file size.
|
Static Public Attributes |
static | $mimes |
Member Function Documentation
static upload::required |
( |
array |
$file | ) |
|
|
static |
Tests if input data has valid upload data.
- Parameters
-
- Returns
- bool
static upload::save |
( |
|
$file, |
|
|
|
$filename = NULL , |
|
|
|
$directory = NULL , |
|
|
|
$chmod = 0644 |
|
) |
| |
|
static |
Save an uploaded file to a new location.
- Parameters
-
mixed | name of $_FILE input or array of upload data |
string | new filename |
string | new directory |
integer | chmod mask |
- Returns
- string full path to new file
static upload::size |
( |
array |
$file, |
|
|
array |
$size |
|
) |
| |
|
static |
Validation rule to test if an uploaded file is allowed by file size.
File sizes are defined as: SB, where S is the size (1, 15, 300, etc) and B is the byte modifier: (B)ytes, (K)ilobytes, (M)egabytes, (G)igabytes. Eg: to limit the size to 1MB or less, you would use "1M".
- Parameters
-
array | $_FILES | item |
| array | maximum file size |
- Returns
- bool
static upload::type |
( |
array |
$file, |
|
|
array |
$allowed_types |
|
) |
| |
|
static |
Validation rule to test if an uploaded file is allowed by extension.
- Parameters
-
array | $_FILES | item |
| array | allowed file extensions |
- Returns
- bool
static upload::valid |
( |
|
$file | ) |
|
|
static |
Tests if input data is valid file type, even if no upload is present.
- Parameters
-
- Returns
- bool
The documentation for this class was generated from the following file: