Свойство | Type | Description | |
---|---|---|---|
$destination | string | The path where uploaded files will be moved to | |
$extensions | array | Holds array of valid file extensions |
Méthode | Description | |
---|---|---|
__construct ( $destination, $extensions = [] ) | Create a new instance of the uploader | |
set_destination ( $path ) | Sets the upload destination path | |
set_extensions ( $extensions ) | Sets the upload accepted extensions | |
upload ( $file, $filename = null ) : string | Upload a file |
Méthode | Description | |
---|---|---|
format_filename ( $filename ) : string | Strips none alphanumeric and dash characters | |
get_error_message ( $error ) : string | Translates error codes to error messages | |
get_filename ( $filename ) : string | Creates a friendly file name | |
validate ( $file ) | Validates the passed $_FILES value and extension |
public __construct ( $destination, $extensions = [] ) |
protected format_filename ( $filename ) : string | ||
Résultat | string |
protected get_error_message ( $error ) : string | ||
Résultat | string |
protected get_filename ( $filename ) : string | ||
Résultat | string |
public set_extensions ( $extensions ) |
protected validate ( $file ) |
protected string $destination | ||
Résultat | string |
protected array $extensions | ||
Résultat | array |