Official Plugins (Kuzzle v1.x)
S3 v1.x
1

You are currently looking at the documentation of a previous version of Kuzzle. We strongly recommend that you use the latest version. You can also use the version selector in the top menu.

getUrl #

Returns a Presigned URL to upload directly to S3.
The URL expires after a configurable TTL. (Configurable in the kuzzlerc file)

File uploaded to the generated URL must be validated with upload:validate otherwise they will be deleted after the same TTL as for the URL expiration.


Query Syntax #

HTTP #

Copied to clipboard!
URL: http://kuzzle:7512/_plugin/s3/upload
Method: GET

Other protocols #

Copied to clipboard!
{
  "controller": "s3/upload",
  "action": "getUrl",

  "filename": "headcrab.png", 
  "uploadDir": "xen" 
}

Arguments #

  • filename: Uploaded file name
  • uploadDir: Upload directory (see s3 file key)

Response #

Returns an object with the following properties:

  • fileKey: file key in S3 bucket
  • uploadUrl: presigned upload URL
  • fileUrl: public file URL after successful upload
  • ttl: TTL in ms for the URL validity and before the uploaded file deletion
Copied to clipboard!
{
  "status": 200,
  "error": null,
  "controller": "s3/upload",
  "action": "getUrl",
  "requestId": "<unique request identifier>",
  "result": {
    "fileKey": "xen/<uuid>-headcrab.png", 
    "uploadUrl": "https://s3.eu-west-3.amazonaws.com/...", 
    "fileUrl": "https://s3.eu-west-3.amazonaws.com/...", 
    "ttl": 1200000 
  }
}

Possible errors #