Documentation
- Overview
- Applet configuration
- Exposed interface
- JavaScript callbacks
- Custom attributes
- Partitioned upload
- Resume broken uploads
- GUI customization
- Internationalization
- Running uploader as standalone application
- Server side upload handling
- Zipped upload
- Scaled images upload
Partitioned upload
(since 1.1)
Most web hosting providers have constraint for maximum allowed request length about 1-3 megabytes. Thus, this is the most lengthy fail possible to upload in a request. If client try upload file bigger than that, server immediately terminate connection and user receive error.
"Partitioned upload" is a technique that allows upload of unlimited length file by splitting file in partitions of specified length. Then, these partitions uploaded in subsequent requests (one request per partition).
If server issue error for some request, client would terminate execution of subsequent requests.
Obviously, it is responsibility of a server side upload handler to reconstruct original file from partitions, and applet provides metadata for that with each request. Metadata is send in POSTed form parameters described in a table below:
| Parameter | Description |
fileId |
Synthetic file id (i.e. "670174"), unique for each file in the applet lifecycle scope (i.e. it is guaranteed that applet instance running on the client will issue different id for each new file in queue, even if added duplicate file). Handlers should use this value for collecting partitions of single file. |
fileLength |
Original file length (bytes). Handlers may use this parameter to evaluate remote file length and, probably, reject trasfer early. |
partitionIndex |
The partition 0-based index |
partitionCount |
The number of partitions (requests) for current file |
So, server should collect and join all partitions.
Please note, same parameters send even if partitioning is disabled.
Partitioning is controlled via applet configuration parameter uc_partitionLength. It is NOT recommended to put values below 100K, because this will result with a big number of requests. The default value for parameter is -1 — partitioning disabled (unlimited partition length).