Uploader - Callbacks and event handling
The <Uploader /> handles its events through callbacks. Most callbacks receive an object named uploadProgress. This is a frequently used object containing details related to the state of a file in regards to the upload process.
The uploadProgress object can contain the following keys:
  • startTime a date time value of when the upload has been started for this object
  • inProgress true if file is currently in upload progress, falsy if not
  • queued true if file is currently in upload progress, falsy if not
  • error object when a upload error has occured
  • done true if file upload was successful, falsy otherwise.
  • uploadedSize number of bytes uploaded, or falsy value when upload did not start
  • totalSize number of total bytes to be uploaded, or falsy when upload did no start
  • uploadTime number the difference between start time and when the upload finished
  • chunkWrapper array of objects containing information about the chunks when a file is in chunked upload mode. The chunkWrapper is an object containing the following props:
    • chunkId the id of the chunk, generated based on the fileid
    • chunkOffsets the start and end offset of the file slice representing this chunk
    • idx the index of the chunk in the chunk array
    • status of type string of values: "queued", "uploading", "aborted", "error" and "done", indicating in what state the chunk is in relation to the upload progress