dolibarr  9.0.0
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

◆ __construct()

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.

Member Function Documentation

◆ createScaledImage()

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 269 of file fileupload.class.php.

◆ delete()

FileUpload::delete ( )

Delete uploaded file.

Returns
void

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

◆ get()

FileUpload::get ( )

Output data.

Returns
void

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

◆ getFileObject()

FileUpload::getFileObject (   $file_name)
protected

getFileObject

Parameters
string$file_nameFilename
Returns
stdClass|null

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

◆ getFileObjects()

FileUpload::getFileObjects ( )
protected

getFileObjects

Returns
void

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

◆ getFullUrl()

FileUpload::getFullUrl ( )
protected

Return full URL.

Returns
string URL

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

◆ handleFileUpload()

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 420 of file fileupload.class.php.

◆ post()

FileUpload::post ( )

Output data.

Returns
void

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

◆ setFileDeleteUrl()

FileUpload::setFileDeleteUrl (   $file)
protected

Set delete url.

Parameters
string$fileFilename
Returns
void

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

◆ trimFileName()

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

trimFileName

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

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

◆ upcountName()

FileUpload::upcountName (   $name)
protected

Enter description here ...

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

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

◆ upcountNameCallback()

FileUpload::upcountNameCallback (   $matches)
protected

Enter description here ...

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

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

◆ validate()

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 303 of file fileupload.class.php.


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