5.15.0

Methods S3

S3

The S3 uploader provides many of the same API methods as the traditional uploader, but there are a few crucial differences to take into account. If you plan to use the S3 uploader, then use the following table as your API reference. All methods outlined in the core or UI documentation are also available in Fine Uploader S3, unless otherwise noted here.

getBucket (fileId)

Retrieve the S3 bucket name associated with the passed file (id). Note that the bucket name is not available before the file has started uploading.

Parameters:
Integer
fileId

An ID corresponding to a file.


Returns:
String
The S3 bucket name associated with the passed file (id)

getKey (fileId)

Retrieve the S3 object key associated with the passed file (id). Note that the key is not available before the file has started uploading.

Parameters:
Integer
fileId

An ID corresponding to a file.


Returns:
String
The S3 object key associated with the passed file (id)

getResumableFilesData ()

Returns an array of potentially resumable items. Each resumable is represented by an object with the following properties:

Property Description
name filename
uuid the unique id
partIdx the index of the part where the resume will start from
key The associated object's S3 key
Returns:
Array
An array of resumable items.

setAcl (newAcl[, id])

Set/update the ACL to be used for one or all file uploads. If the ID is omitted, the new ACL targets all future files that have not yet been uploaded.

Parameters:
String
newAcl

Canned ACL value to be sent with the upload request. Used by S3.


Integer
id

File ID to target the ACL.


setCredentials (newCredentials)

Pass new or initial credentials. This is used to support the no-server workflow.

Parameters:
Object
newCredentials

The new or initial credentials to set for server-less uploads


setEndpoint (endpoint[, id])

Modify the endpoint URL where upload requests should be directed. The endpoint for a specific file or blob can be changed by passing in an optional id parameter. An id will always be a number and refers to a single file. All valid bucket URLs documented by Amazon are supported, including custom domains. SSL is also supported. If you specify a CDN endpoint URL, be sure that you are specifying a bucket as well via the objectProperties.bucket option.

Parameters:
String
endpoint

A URL for the S3 bucket or a CDN that forwards the request on to S3.


Integer
id

An ID corresponding to a file.


setUploadSuccessEndpoint (endpoint[, id])

Modify the endpoint that Fine Uploader should POST to when a file has been successfully uploaded to S3.

Parameters:
String
endpoint

An endpoint that Fine Uploader should POST to when a file has been successfully uploaded to S3.


Integer
id

An ID corresponding to a file.


setUploadSuccessParams (newParams[, id])

Set additional parameters for the upload success request. Note that Fine Uploader will still send the bucket name, key, filename, UUID, and etag (if available) as well.

Parameters:
Object
newParams

The additional parameters set for the upload request.


Integer
id

A file id to apply these upload success parameters to.