Official Plugins (Kuzzle v2.x)
S3 v2.x
2

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 #

URL: http://kuzzle:7512/_plugin/s3/upload
Method: GET

Other protocols #

{
  "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
{
  "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 #