dolibarr 21.0.0-alpha
|
This class is used to manage file upload using ajax. More...
Public Member Functions | |
__construct ($options=null, $fk_element=null, $element=null) | |
Constructor. | |
post () | |
Output data. | |
Protected Member Functions | |
getFullUrl () | |
Return full URL. | |
setFileDeleteUrl ($file) | |
Set delete url. | |
getFileObject ($file_name) | |
getFileObject | |
getFileObjects () | |
getFileObjects | |
createScaledImage ($file_name, $options) | |
Create thumbs of a file uploaded. | |
validate ($uploaded_file, $file, $error, $index) | |
Make validation on an uploaded file. | |
upcountNameCallback ($matches) | |
Enter description here ... | |
upcountName ($name) | |
Enter description here ... | |
trimFileName ($name, $type, $index) | |
trimFileName | |
handleFileUpload ($uploaded_file, $name, $size, $type, $error, $index) | |
handleFileUpload. | |
This class is used to manage file upload using ajax.
Definition at line 35 of file fileupload.class.php.
FileUpload::__construct | ( | $options = null, | |
$fk_element = null, | |||
$element = null ) |
Constructor.
This set ->$options
?array{script_url?:string,upload_dir?:string,upload_url?:string,param_name?:string,delete_type?:string,max_file_size?:?int,min_file_size?:int,accept_file_types?:string,max_number_of_files?:?int,max_width?:?int,max_height?:?int,min_width?:int,min_height?:int,discard_aborted_uploads?:bool,image_versions?:array<string,array{upload_dir?:string,upload_url?:string,max_width?:int,max_height?:int,jpeg_quality?:int}>} | $options Options array | |
int | $fk_element | ID of element |
string | $element | Code of element |
Definition at line 59 of file fileupload.class.php.
References $object, dol_include_once(), dol_sanitizeFileName(), dol_sanitizePathName(), fetchObjectByElement(), get_exdir(), getElementProperties(), and setEventMessage().
|
protected |
Create thumbs of a file uploaded.
string | $file_name | Filename |
array{upload_dir:string} | $options is array('max_width', 'max_height') |
Definition at line 268 of file fileupload.class.php.
References dol_mkdir(), and vignette().
Referenced by handleFileUpload().
|
protected |
getFileObject
string | $file_name | Filename |
Definition at line 225 of file fileupload.class.php.
References dol_is_file(), dol_mimetype(), and setFileDeleteUrl().
|
protected |
getFileObjects
Definition at line 256 of file fileupload.class.php.
Referenced by validate().
|
protected |
|
protected |
handleFileUpload.
Validate data, move the uploaded file then create the thumbs if this is an image.
string | $uploaded_file | Upload file |
string | $name | Name |
int | $size | Size |
string | $type | Type |
string | $error | Error |
string | $index | Index |
Definition at line 423 of file fileupload.class.php.
References createScaledImage(), dol_filesize(), dol_is_file(), dol_mimetype(), dol_mkdir(), dol_move_uploaded_file(), dol_sanitizePathName(), setFileDeleteUrl(), trimFileName(), and validate().
Referenced by post().
FileUpload::post | ( | ) |
Output data.
Definition at line 508 of file fileupload.class.php.
References handleFileUpload().
|
protected |
Set delete url.
stdClass | $file | File object (see getFileObject) |
Definition at line 210 of file fileupload.class.php.
Referenced by getFileObject(), and handleFileUpload().
|
protected |
trimFileName
string | $name | Filename |
string | $type | ??? |
string | $index | ??? |
Definition at line 393 of file fileupload.class.php.
References dol_is_file(), dol_sanitizeFileName(), and upcountName().
Referenced by handleFileUpload().
|
protected |
Enter description here ...
string | $name | ??? |
Definition at line 380 of file fileupload.class.php.
Referenced by trimFileName().
|
protected |
Enter description here ...
int | $matches | ??? |
Definition at line 367 of file fileupload.class.php.
|
protected |
Make validation on an uploaded file.
string | $uploaded_file | Upload file |
object | $file | File |
string | $error | Error |
string | $index | Index |
Definition at line 306 of file fileupload.class.php.
References dol_filesize(), and getFileObjects().
Referenced by handleFileUpload().