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 |
channel string — REQUIREDThe channel name to perform the operation on. |
Request Body — REQUIREDThe request body contains the user-supplied filename |
---|
name string |
Responses |
---|
200
Successfully generated a file upload request Schema — OPTIONAL |
---|
status integer — OPTIONAL | data object — OPTIONALid string — OPTIONALPubNub-generated unique identifier to add uniqueness to upload file key | name string — OPTIONALUser-defined name after PubNub sanitization |
| file_upload_request object — OPTIONALInfo needed to create a file upload request url string — OPTIONAL | method string — OPTIONAL | expiration_date string — OPTIONALExpiration date (ISO 8601 format) for the presigned upload request | form_fields object[] — OPTIONALAn 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 | value string — OPTIONAL |
|
|
|
400
The request body contained invalid data Schema — OPTIONAL |
---|
status integer — OPTIONAL | error object — OPTIONALsource string — OPTIONALThe PubNub service from which the error originated | message string — OPTIONAL | code integer — OPTIONAL |
|
|
402
The Files service is not enabled for the subkey Schema — OPTIONAL |
---|
status integer — OPTIONAL | error object — OPTIONALsource string — OPTIONALThe PubNub service from which the error originated | message string — OPTIONAL | code integer — OPTIONAL |
|
|
415
The format of the supplied request body isn't supported. The request body must be in JSON format. Schema — OPTIONAL |
---|
status integer — OPTIONAL | error object — OPTIONALsource string — OPTIONALThe PubNub service from which the error originated | message string — OPTIONAL | code integer — OPTIONAL |
|
|
Schema — OPTIONAL |
---|
status integer — OPTIONAL | error object — OPTIONALsource string — OPTIONALThe PubNub service from which the error originated | message string — OPTIONAL | code integer — OPTIONAL |
|
|