5.16.2
This feature is targeted at integrators with an application that requires a list of files from a previous session to be fed into the uploader during initialization. If enabled, Fine Uploader will ask your server for metadata about file items previously uploaded. All items returned from your server will be loaded into Fine Uploader, and you will be able to optionally delete these files. All relevant API methods can be used on these pre-loaded files. If you are using Fine Uploader UI, they will be displayed as successfully uploaded files as well.
The API includes a session
option
and a sessionRequestComplete
event, and an addInitialFiles
method.
After the array of file items has been retrieved from the server, all valid items will be loaded into the uploader
instance. Internal data structures will be updated with this data, making all relevant API methods possible, such as
getName
, getUuid
, getUploads
, deleteFile
, etc.
All loaded file items will include a status of qq.status.UPLOAD_SUCCESSFUL
.
Fine Uploader will assign IDs to each file item as well. Also note that file items loaded into Fine Uploader will be
counted when determining if you have reached your validation.itemLimit
.
In addition to everything described in the above core session, all files loaded into Fine Uploader on startup (or after a reset) will be displayed in Fine Uploader UI as successfully uploaded files. If the delete file feature is enabled, a delete button will appear next to each file as well.
Support for S3 with or without UI mode is the same, except an additional property for each file item is required: s3Key
.
The value of this property must be the current key of the file in your S3 bucket.
Support for Azure with or without UI mode is the same, except an additional property for each file item is required: blobName
.
The value of this property must be the current name of the Azure blob.
If you have specified a value for the session.endpoint
option, Fine Uploader will send a GET request to your endpoint
on startup (and optionally when the instance is reset). The response to this request must be valid JSON. More
specifically, it must be a JSON array containing Object
s for each file to be fed into the uploader.
Here are the following properties of each Object
that Fine Uploader recognizes (* = required):
String
- Name of the file.String
- UUID of the file.Number
- Size of the file, in bytes.String
- Endpoint for the associated delete file request. If omitted, the deleteFile.endpoint
is used.Object
- Parameters to send along with the associated delete file request. If omitted, deleteFile.params
is used.String
- URL of an image to display next to the file.String
- Key of the file in your S3 bucket. Only required if using Fine Uploader S3.String
- Name of the bucket where the file is stored in S3. Only required if using Fine Uploader S3 and if the bucket cannot be determined by examining the endpoint URL (such as when routing through a CDN).String
- Name of the file in your Azure Blob Storage container. Only required if using Fine Uploader Azure.The response will be converted into a JavaScript Array
and passed to your sessionRequestComplete
event handler.
So, any non-standard object properties passed with your server response will also be passed to your event handler.
Additionally: