Handles file uploads in chunks using the JS File API and XMLHttpRequest
This is the code documentation for the SproutCMS project
Search documentation |
class FileUploadControllerHandles file uploads in chunks using the JS File API and XMLHttpRequest
Functions
public chunkSizeCheckvoid $FileUploadController->chunkSizeCheck ( ); Perform a size check on a set of uploaded chunks. To be implemented by subclasses protected cleanupChunksvoid $FileUploadController->cleanupChunks ( string $code , int $num_chunks ); Clean up any left-over chunks public clearSessionvoid $FileUploadController->clearSession ( ); This function does not have a description public extraChunkCheckvoid $FileUploadController->extraChunkCheck ( ); Perform additional checks (beyond the checks already in FileUploadController::uploadChunk) on an uploaded chunk. To be implemented by subclasses public fileExtCheckvoid $FileUploadController->fileExtCheck ( mixed $temp_path ); Perform a file extension check. To be implemented by subclasses public fileSizeCheckvoid $FileUploadController->fileSizeCheck ( string &$temp_path ); Perform a size check on a completed upload (after chunks have been stitched). To be implemented by subclasses public session&array $FileUploadController->session ( ); Gets the session data associated with a file upload protected startSession&array $FileUploadController->startSession ( ); Creates a session record for a new file upload, and configures its initial state private stitchChunksint $FileUploadController->stitchChunks ( string $dest_filename , string $code , string $num_chunks ); Stitch together the uploaded file from multiple chunks public uploadBeginvoid $FileUploadController->uploadBegin ( ); Signals that the user would like to upload a file Perform basic sanity checks and establish (or reset) their session state public uploadCancelvoid $FileUploadController->uploadCancel ( ); Cancel an upload - delete temporary files. May receive two different variations on the provided POST data: [result][tmp_file] Whole file was uploaded [partial_upload][code] Only some chunks of the file have been uploaded public uploadChunkvoid $FileUploadController->uploadChunk ( ); Save a single chunk of a multi-part file upload public uploadDonevoid $FileUploadController->uploadDone ( ); Stitch together uploaded chunks into an actual file Outputs a JSON response. The field "success" will be checked (= 1) to determine success. On error, the field "message" will be used as an error message. Other keys provided are passed to the ajaxDragdropForm method. public uploadFormvoid $FileUploadController->uploadForm ( ); Returns the form for updating a file which has been uploaded protected validateCodestring $FileUploadController->validateCode ( ); Checks POSTed code matched the expected format |
| Powered by Pelzini, version 0.9.0 |
Documentation is made available under the
GNU Free Documentation License 1.2. Generated: Tuesday, 15th September, 2026 at 10:26 am |
|