Skip to content
This repository has been archived by the owner on Oct 25, 2022. It is now read-only.

CupFile

aparajita edited this page May 10, 2013 · 1 revision

A wrapper for the File API that allows the values to be used in bindings. Note that if the browser does not support the File API, the size, type, and percentComplete properties will be zero/empty.

These objects are stored in the Cup queue controller, thus you can bind through the queue controller's arrangedObjects or selection to properties of this class.

Properties

This class exposes the following KVO compliant read-only properties:

name

The filename of the file.

size

The file's size in bytes.

type

The file's mime type.

status

One of the CupStatus constants below.

uploading

A BOOL set to YES when the file is uploading.

uploadedBytes

The number of bytes uploaded so far for this file.

bitrate

The upload bitrate for this file.

percentComplete

An integer from 0-100 representing the percentage of the file that has been uploaded so far.

indeterminate

A BOOL that indicates whether the total size of the file is known. This affects what is reported in the progress callbacks.

data

The Javascript data object used by jQuery File Upload.

Constants

There are three constants returned by the status property:

CupFileStatusPending

The file is in the queue but has not been submitted for uploading, or was submitted but was stopped or the upload failed.

CupFileStatusUploading

The file is currently uploading.

CupFileStatusComplete

The file successfully uploaded.