dolibarr 19.0.3
|
This class is used to manage file upload using ajax. More...
Public Member Functions | |
__construct ($options=null, $fk_element=null, $element=null) | |
Constructor. | |
get () | |
Output data. | |
post () | |
Output data. | |
delete () | |
Delete uploaded file. | |
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 32 of file fileupload.class.php.
FileUpload::__construct | ( | $options = null, | |
$fk_element = null, | |||
$element = null ) |
Constructor.
This set ->$options
array | $options | Options array |
int | $fk_element | ID of element |
string | $element | Code of element |
Definition at line 46 of file fileupload.class.php.
References dol_include_once(), dol_sanitizeFileName(), dol_sanitizePathName(), fetchObjectByElement(), get_exdir(), getElementProperties(), and setEventMessage().
|
protected |
Create thumbs of a file uploaded.
string | $file_name | Filename |
string | $options | is array('max_width', 'max_height') |
Definition at line 254 of file fileupload.class.php.
References dol_mkdir(), and vignette().
Referenced by handleFileUpload().
FileUpload::delete | ( | ) |
Delete uploaded file.
Definition at line 565 of file fileupload.class.php.
References dol_is_file(), and GETPOST().
FileUpload::get | ( | ) |
Output data.
Definition at line 475 of file fileupload.class.php.
References getFileObject(), and getFileObjects().
|
protected |
getFileObject
string | $file_name | Filename |
Definition at line 212 of file fileupload.class.php.
References dol_is_file(), dol_mimetype(), and setFileDeleteUrl().
Referenced by get().
|
protected |
getFileObjects
Definition at line 242 of file fileupload.class.php.
Referenced by get(), and validate().
|
protected |
|
protected |
handleFileUpload.
Validate data, move the uploaded file then create the thumbs if this is an image.
string | $uploaded_file | Uploade file |
string | $name | Name |
int | $size | Size |
string | $type | Type |
string | $error | Error |
string | $index | Index |
Definition at line 409 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 493 of file fileupload.class.php.
References handleFileUpload().
|
protected |
Set delete url.
object | $file | Filename |
Definition at line 197 of file fileupload.class.php.
Referenced by getFileObject(), and handleFileUpload().
|
protected |
trimFileName
string | $name | Filename |
string | $type | ??? |
string | $index | ??? |
Definition at line 379 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 366 of file fileupload.class.php.
Referenced by trimFileName().
|
protected |
Enter description here ...
int | $matches | ??? |
Definition at line 353 of file fileupload.class.php.
|
protected |
Make validation on an uploaded file.
string | $uploaded_file | Uploade file |
object | $file | File |
string | $error | Error |
string | $index | Index |
Definition at line 292 of file fileupload.class.php.
References dol_filesize(), and getFileObjects().
Referenced by handleFileUpload().