dolibarr  7.0.0-beta
Public Member Functions | Protected Member Functions | List of all members
FileUpload Class Reference

This class is used to manage file upload using ajax. More...

Public Member Functions

 __construct ($options=null, $fk_element=null, $element=null)
 Constructor. More...
 
 get ()
 Output data. More...
 
 post ()
 Output data. More...
 
 delete ()
 Delete uploaded file. More...
 

Protected Member Functions

 getFullUrl ()
 Return full URL. More...
 
 setFileDeleteUrl ($file)
 Set delete url. More...
 
 getFileObject ($file_name)
 getFileObject More...
 
 getFileObjects ()
 getFileObjects More...
 
 createScaledImage ($file_name, $options)
 Create thumbs of a file uploaded. More...
 
 validate ($uploaded_file, $file, $error, $index)
 Enter description here ... More...
 
 upcountNameCallback ($matches)
 Enter description here ... More...
 
 upcountName ($name)
 Enter description here ... More...
 
 trimFileName ($name, $type, $index)
 trimFileName More...
 
 handleFileUpload ($uploaded_file, $name, $size, $type, $error, $index)
 handleFileUpload More...
 

Detailed Description

This class is used to manage file upload using ajax.

Definition at line 31 of file fileupload.class.php.

Constructor & Destructor Documentation

FileUpload::__construct (   $options = null,
  $fk_element = null,
  $element = null 
)

Constructor.

Parameters
array$optionsOptions array
int$fk_elementfk_element
string$elementelement

Definition at line 44 of file fileupload.class.php.

References dol_include_once(), dol_sanitizeFileName(), and get_exdir().

Member Function Documentation

FileUpload::createScaledImage (   $file_name,
  $options 
)
protected

Create thumbs of a file uploaded.

Only the "mini" thumb is generated.

Parameters
string$file_nameFilename
string$optionsis array('max_width', 'max_height')
Returns
boolean

Definition at line 266 of file fileupload.class.php.

References dol_mkdir(), and vignette().

FileUpload::delete ( )

Delete uploaded file.

Returns
void

Definition at line 550 of file fileupload.class.php.

FileUpload::get ( )

Output data.

Returns
void

Definition at line 472 of file fileupload.class.php.

FileUpload::getFileObject (   $file_name)
protected

getFileObject

Parameters
string$file_nameFilename
Returns
stdClass|NULL

Definition at line 227 of file fileupload.class.php.

References dol_mimetype(), and setFileDeleteUrl().

FileUpload::getFileObjects ( )
protected

getFileObjects

Returns
void

Definition at line 254 of file fileupload.class.php.

FileUpload::getFullUrl ( )
protected

Return full URL.

Returns
string URL

Definition at line 193 of file fileupload.class.php.

FileUpload::handleFileUpload (   $uploaded_file,
  $name,
  $size,
  $type,
  $error,
  $index 
)
protected

handleFileUpload

Parameters
string$uploaded_fileUploade file
string$nameName
int$sizeSize
string$typeType
string$errorError
string$indexIndex
Returns
stdClass

Definition at line 417 of file fileupload.class.php.

References dol_mimetype(), dol_mkdir(), and dol_move_uploaded_file().

FileUpload::post ( )

Output data.

Returns
void

Definition at line 493 of file fileupload.class.php.

FileUpload::setFileDeleteUrl (   $file)
protected

Set delete url.

Parameters
string$fileFilename
Returns
void

Definition at line 211 of file fileupload.class.php.

Referenced by getFileObject().

FileUpload::trimFileName (   $name,
  $type,
  $index 
)
protected

trimFileName

Parameters
string$nameFilename
string$type???
string$index???
Returns
string

Definition at line 385 of file fileupload.class.php.

FileUpload::upcountName (   $name)
protected

Enter description here ...

Parameters
string$name???
Returns
string ???

Definition at line 372 of file fileupload.class.php.

FileUpload::upcountNameCallback (   $matches)
protected

Enter description here ...

Parameters
int$matches???
Returns
string ???

Definition at line 359 of file fileupload.class.php.

FileUpload::validate (   $uploaded_file,
  $file,
  $error,
  $index 
)
protected

Enter description here ...

Parameters
string$uploaded_fileUploade file
string$fileFile
string$errorError
string$indexIndex
Returns
boolean True if OK, False if KO

Definition at line 300 of file fileupload.class.php.


The documentation for this class was generated from the following file: