Combu Server  3.1.1
PHP API Documentation
Public Member Functions
FileUpload Class Reference

Public Member Functions

 __construct ($inputName, $rootPath=null, $createTempStruct=true)
 
 SetAllowedExtensions ($allowedExtensions)
 
 IsUploaded ()
 
 GetTempname ($fileExt=".tmp")
 
 GetFilenameExtension ($filename)
 
 Upload ()
 
 GetDestinationPath ()
 
 GetDestinationUrl ()
 

Detailed Description

Management class for file uploads handle

Definition at line 8 of file FileUpload.php.

Constructor & Destructor Documentation

◆ __construct()

__construct (   $inputName,
  $rootPath = null,
  $createTempStruct = true 
)

Constructor

Parameters
string$inputNameName of the INPUT form field
string$rootPathPath of the upload root folder
string$createTempStructIf TRUE then create a directory tree in the upload root (year-month-day)

Definition at line 24 of file FileUpload.php.

Member Function Documentation

◆ GetDestinationPath()

GetDestinationPath ( )

Get the destination folder path relative to the root folder

Returns
string The destination folder relative path

Definition at line 175 of file FileUpload.php.

◆ GetDestinationUrl()

GetDestinationUrl ( )

Get the address URL of the destination folder relative to the root path

Returns
string The destination folder address URL

Definition at line 184 of file FileUpload.php.

◆ GetFilenameExtension()

GetFilenameExtension (   $filename)

Definition at line 76 of file FileUpload.php.

◆ GetTempname()

GetTempname (   $fileExt = ".tmp")

Definition at line 71 of file FileUpload.php.

◆ IsUploaded()

IsUploaded ( )

Check if a file has been uploaded

Returns
boolean Return TRUE if a file has been uploaded

Definition at line 60 of file FileUpload.php.

◆ SetAllowedExtensions()

SetAllowedExtensions (   $allowedExtensions)

Set the allowed file extensions to upload

Parameters
string$allowedExtensionsArray of allowed extensions (each extension should include prefix '.')

Definition at line 42 of file FileUpload.php.

◆ Upload()

Upload ( )

Do an upload action

Returns
boolean Return TRUE on successful upload

Definition at line 89 of file FileUpload.php.