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 nameuploadDir
: Upload directory (see s3 file key)
Response #
Returns an object with the following properties:
fileKey
: file key in S3 bucketuploadUrl
: presigned upload URLfileUrl
: public file URL after successful uploadttl
: 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 #
Edit this page on Github(opens new window)