ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
|
Class FileUpload. More...
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... | |
Class FileUpload.
This interface provides the public operations for the rest of ILIAS.
Definition at line 21 of file FileUpload.php.
ILIAS\FileUpload\FileUpload::getResults | ( | ) |
Returns the results of the processing and moving operation of the uploaded files.
IllegalStateException | If the method is called before the files are processed. |
Implemented in ILIAS\FileUpload\FileUploadImpl.
ILIAS\FileUpload\FileUpload::hasBeenProcessed | ( | ) |
Return (bool)true if the current upload has already been processed.
Implemented in ILIAS\FileUpload\FileUploadImpl.
ILIAS\FileUpload\FileUpload::hasUploads | ( | ) |
Return (bool)true if one ore more file-uploads are in the current request, (bool)false if not.
Implemented in ILIAS\FileUpload\FileUploadImpl.
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.
string | $destination | The destination of the uploaded files. |
int | $location | The filesystem location which should be used. |
IllegalStateException | Thrown if the files are not processed before invoking the moveFilesTo method. |
Implemented in ILIAS\FileUpload\FileUploadImpl.
ILIAS\FileUpload\FileUpload::moveOneFileTo | ( | UploadResult | $UploadResult, |
$destination, | |||
$location = Location::STORAGE , |
|||
$file_name = '' , |
|||
$override_existing = false |
|||
) |
Moves a single UploadResult to the given destination.
UploadResult | $UploadResult | Which upload result do you want to move? |
string | $destination | Where do you want to move the file? |
int | $location | Location::[STORAGE|WEB|CUSTOMIZING] |
string | $file_name | Do you want to rename the file? |
bool | $override_existing | Override existing file with same name |
Implemented in ILIAS\FileUpload\FileUploadImpl.
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.
IllegalStateException | If the files already got processed. |
Referenced by ILIAS\FileUpload\FileUploadImpl\register().
ILIAS\FileUpload\FileUpload::register | ( | PreProcessor | $preProcessor | ) |
Register a new preprocessor instance.
The preprocessor instances are invoked for each uploaded file.
PreProcessor | $preProcessor | The preprocessor instance which should be registered. |
IllegalStateException | If the register method is called after the files already got processed. |
Implemented in ILIAS\FileUpload\FileUploadImpl.
ILIAS\FileUpload\FileUpload::uploadSizeLimit | ( | ) |
Returns the current upload size limit in bytes.
Implemented in ILIAS\FileUpload\FileUploadImpl.