ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ILIAS\FileUpload\FileUpload Interface Reference

Class FileUpload. More...

+ Inheritance diagram for ILIAS\FileUpload\FileUpload:
+ Collaboration diagram for ILIAS\FileUpload\FileUpload:

Public Member Functions

 moveFilesTo ($destination, $location=Location::STORAGE)
 Moves all uploaded files to the given destination after the processors had processed the files. More...
 
 moveOneFileTo (UploadResult $UploadResult, $destination, $location=Location::STORAGE, $file_name='', $override_existing=false)
 Moves a single UploadResult to the given destination. More...
 
 uploadSizeLimit ()
 Returns the current upload size limit in bytes. More...
 
 register (PreProcessor $preProcessor)
 Register a new preprocessor instance. More...
 
 process ()
 Invokes all preprocessors for each uploaded file in the sequence they got registered. More...
 
 getResults ()
 Returns the results of the processing and moving operation of the uploaded files. More...
 
 hasUploads ()
 Return (bool)true if one ore more file-uploads are in the current request, (bool)false if not. More...
 
 hasBeenProcessed ()
 Return (bool)true if the current upload has already been processed. More...
 

Detailed Description

Class FileUpload.

This interface provides the public operations for the rest of ILIAS.

Author
Nicolas Schäfli ns@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch
Since
5.3
Version
1.0

Definition at line 21 of file FileUpload.php.

Member Function Documentation

◆ getResults()

ILIAS\FileUpload\FileUpload::getResults ( )

Returns the results of the processing and moving operation of the uploaded files.

Returns
UploadResult[]
Exceptions
IllegalStateExceptionIf the method is called before the files are processed.
Since
5.3

Implemented in ILIAS\FileUpload\FileUploadImpl.

◆ hasBeenProcessed()

ILIAS\FileUpload\FileUpload::hasBeenProcessed ( )

Return (bool)true if the current upload has already been processed.

Returns
bool
Since
5.3

Implemented in ILIAS\FileUpload\FileUploadImpl.

◆ hasUploads()

ILIAS\FileUpload\FileUpload::hasUploads ( )

Return (bool)true if one ore more file-uploads are in the current request, (bool)false if not.

Returns
bool
Since
5.3

Implemented in ILIAS\FileUpload\FileUploadImpl.

◆ moveFilesTo()

ILIAS\FileUpload\FileUpload::moveFilesTo (   $destination,
  $location = Location::STORAGE 
)

Moves all uploaded files to the given destination after the processors had processed the files.

Only files which got accepted by the processors are moved. Please make sure to process the uploaded files first with the help of the process method.

Please note that the Location interface defines all valid location.

Parameters
string$destinationThe destination of the uploaded files.
int$locationThe filesystem location which should be used.
Returns
void
Exceptions
IllegalStateExceptionThrown if the files are not processed before invoking the moveFilesTo method.

Implemented in ILIAS\FileUpload\FileUploadImpl.

◆ moveOneFileTo()

ILIAS\FileUpload\FileUpload::moveOneFileTo ( UploadResult  $UploadResult,
  $destination,
  $location = Location::STORAGE,
  $file_name = '',
  $override_existing = false 
)

Moves a single UploadResult to the given destination.

Parameters
UploadResult$UploadResultWhich upload result do you want to move?
string$destinationWhere do you want to move the file?
int$locationLocation::[STORAGE|WEB|CUSTOMIZING]
string$file_nameDo you want to rename the file?
bool$override_existingOverride existing file with same name
Returns
void

Implemented in ILIAS\FileUpload\FileUploadImpl.

◆ process()

ILIAS\FileUpload\FileUpload::process ( )

Invokes all preprocessors for each uploaded file in the sequence they got registered.

If a processor fails or returns unexpected results the file which got processed is automatically rejected to prevent ILIAS from using unprocessed files.

Returns
void
Exceptions
IllegalStateExceptionIf the files already got processed.
Since
5.3

Referenced by ILIAS\FileUpload\FileUploadImpl\register().

+ Here is the caller graph for this function:

◆ register()

ILIAS\FileUpload\FileUpload::register ( PreProcessor  $preProcessor)

Register a new preprocessor instance.

The preprocessor instances are invoked for each uploaded file.

Parameters
PreProcessor$preProcessorThe preprocessor instance which should be registered.
Returns
void
Exceptions
IllegalStateExceptionIf the register method is called after the files already got processed.
Since
5.3

Implemented in ILIAS\FileUpload\FileUploadImpl.

◆ uploadSizeLimit()

ILIAS\FileUpload\FileUpload::uploadSizeLimit ( )

Returns the current upload size limit in bytes.

Returns
int
Since
5.3

Implemented in ILIAS\FileUpload\FileUploadImpl.


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