Свойство | Тип | Описание | |
---|---|---|---|
$destination | string | The path where uploaded files will be moved to | |
$extensions | array | Holds array of valid file extensions |
Метод | Описание | |
---|---|---|
__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 |
Метод | Описание | |
---|---|---|
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 | ||
Результат | string |
protected get_error_message ( $error ) : string | ||
Результат | string |
protected get_filename ( $filename ) : string | ||
Результат | string |
public set_extensions ( $extensions ) |
protected validate ( $file ) |
protected string $destination | ||
Результат | string |
protected array $extensions | ||
Результат | array |