Generate file upload URL

Generate a presigned request for file upload.

The response object includes an upload URL, method (such as GET), time to live, and a set of form fields to be included in the request body. You then use these to perform an HTTP operation to perform the file upload to the storage service. Multi-part uploads are supported.

The time to live is generally short, such as one minute. If you make the upload request after the upload URL has expired, the request will fail.

Path Parameters
sub_key string REQUIRED

Your app's subscribe key from Admin Portal.

channel string REQUIRED

The channel name to perform the operation on.

Request Body REQUIRED

The request body contains the user-supplied filename

name string

User-supplied filename

Responses
200

Successfully generated a file upload request

Schema OPTIONAL
status integer OPTIONAL

Status code

data object OPTIONAL
id string OPTIONAL

PubNub-generated unique identifier to add uniqueness to upload file key

name string OPTIONAL

User-defined name after PubNub sanitization

file_upload_request object OPTIONAL

Info needed to create a file upload request

url string OPTIONAL

File upload URL

method string OPTIONAL

File upload URL method

expiration_date string OPTIONAL

Expiration date (ISO 8601 format) for the presigned upload request

form_fields object[] OPTIONAL

An array of form fields to be used in the presigned POST request. You must supply these fields in the order in which you receive them from the server.

name string OPTIONAL

Form field name

value string OPTIONAL

Form field value

400

The request body contained invalid data

Schema OPTIONAL
status integer OPTIONAL

Status code

error object OPTIONAL
source string OPTIONAL

The PubNub service from which the error originated

message string OPTIONAL

Response message

code integer OPTIONAL

Internal error code

402

The Files service is not enabled for the subkey

Schema OPTIONAL
status integer OPTIONAL

Status code

error object OPTIONAL
source string OPTIONAL

The PubNub service from which the error originated

message string OPTIONAL

Response message

code integer OPTIONAL

Internal error code

415

The format of the supplied request body isn't supported. The request body must be in JSON format.

Schema OPTIONAL
status integer OPTIONAL

Status code

error object OPTIONAL
source string OPTIONAL

The PubNub service from which the error originated

message string OPTIONAL

Response message

code integer OPTIONAL

Internal error code

500

Internal Server Error

Schema OPTIONAL
status integer OPTIONAL

Status code

error object OPTIONAL
source string OPTIONAL

The PubNub service from which the error originated

message string OPTIONAL

Response message

code integer OPTIONAL

Internal error code