-
-
Notifications
You must be signed in to change notification settings - Fork 177
More
If upload has failed (like file size limit, exception is raised)
Determines if the file object is in the request
Tries to handle the upload request. If the file is not uploaded, returns false. If the file is present in the request, it will create the save object.
If the file in the request is chunk, it will create the ChunkSave
object, otherwise creates the SingleSave
which does nothing at this moment.
Objects that will handle parsing request data for chunk detection for every provider.
Use AbstractHandler
for type hint or use a specific handler to se additional methods.
- supported by blueimp-file-upload
- uses the Content-range header with the bytes range
-
getBytesStart()
- returns the starting bytes for current request -
getBytesEnd()
- returns the ending bytes for current request -
getBytesTotal()
- returns the total bytes for the file
- Supported by plupload
- uses the chunks numbers from the request
- Supported by resumable.js
- uses the chunks numbers from the request
- Supported by DropZone
- uses the chunks numbers from the request
See the Contribution
section in Readme
You can use the automatic detection of the correct handler (provider) by using the HandlerFactory::classFromRequest
as
a third parameter when constructing the FileReceiver
.
// Exception is thrown if file upload is invalid (size limit, etc)
$receiver = new FileReceiver("file", $request, HandlerFactory::classFromRequest($request));
The default fallback class is stored in the HandlerFactory (default SingleUploadHandler::class
).
You can change it globally by calling
HandlerFactory::setFallbackHandler(CustomHandler::class)
or pass as second parameter when using
HandlerFactory::classFromRequest($request, CustomHandler::class)