Base SystemFineUploadHandler class to work with ajaxfineupload.php endpoint
Upload files as specified
Do not use or reference this directly from your client-side code. Instead, this should be required via the endpoint.php or endpoint-cors.php file(s).
@license MIT License (MIT)
- Copyright
- Copyright (c) 2015-present, Widen Enterprises, Inc. The MIT License (MIT) Copyright (c) 2015-present, Widen Enterprises, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
◆ __construct()
__construct |
( |
\stdClass |
$claims | ) |
|
◆ cleanupChunks()
Deletes all file parts in the chunks folder for files uploaded more than chunksExpireIn seconds ago
- Renvoie
- void
◆ combineChunks()
combineChunks |
( |
|
$uploadDirectory, |
|
|
|
$name = null |
|
) |
| |
Combine chunks into a single file
- Paramètres
-
string | $uploadDirectory | upload directory |
string | null | $name | name |
- Renvoie
- array response to be json encoded and returned to client
◆ getName()
Get the original filename
◆ getUniqueTargetPath()
getUniqueTargetPath |
( |
|
$uploadDirectory, |
|
|
|
$filename |
|
) |
| |
|
protected |
Returns a path to use with this upload. Check that the name does not exist, and appends a suffix otherwise.
- Paramètres
-
string | $uploadDirectory | Target directory |
string | $filename | The name of the file to use. |
- Renvoie
- string|false path or false if path could not be determined
◆ getUploadName()
Get the name of the uploaded file
- Renvoie
- string
◆ handleDelete()
handleDelete |
( |
|
$uploadDirectory, |
|
|
|
$name = null |
|
) |
| |
Process a delete.
- Paramètres
-
string | $uploadDirectory | Target directory. |
string | null | $name | Overwrites the name of the file. |
- Renvoie
- array response to be json encoded and returned to client
◆ handleUpload()
handleUpload |
( |
|
$uploadDirectory, |
|
|
|
$name = null |
|
) |
| |
Process the upload.
- Paramètres
-
string | $uploadDirectory | Target directory. |
string | $name | Overwrites the name of the file. |
- Renvoie
- array response to be json encoded and returned to client
◆ isInaccessible()
isInaccessible |
( |
|
$directory | ) |
|
|
protected |
Determines whether a directory can be accessed.
is_executable() is not reliable on Windows prior PHP 5.0.0 (http://www.php.net/manual/en/function.is-executable.php) The following tests if the current OS is Windows and if so, merely checks if the folder is writable; otherwise, it checks additionally for executable status (like before).
- Paramètres
-
string | $directory | The target directory to test access |
- Renvoie
- bool true if directory is NOT accessible
◆ isWindows()
Determines is the OS is Windows or not
- Renvoie
- boolean
◆ removeDir()
Removes a directory and all files contained inside
- Paramètres
-
- Renvoie
- void
◆ storeUploadedFile()
storeUploadedFile |
( |
|
$target, |
|
|
|
$mimeType, |
|
|
|
$uuid |
|
) |
| |
|
protected |
◆ toBytes()
Converts a given size with units to bytes.
- Paramètres
-
- Renvoie
- int
◆ $allowedExtensions
$allowedExtensions = array() |
◆ $allowedMimeTypes
$allowedMimeTypes = array('(none)') |
◆ $chunksCleanupProbability
$chunksCleanupProbability = 0.001 |
◆ $chunksExpireIn
◆ $chunksFolder
◆ $claims
◆ $inputName
◆ $sizeLimit
◆ $uploadName
La documentation de cette classe a été générée à partir du fichier suivant :