Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
uploading strategies
// Option one: directly upload base64 encoded files
// Pros: one network trip
// Cons: large attachments might cause processing delays and eventual lambda timeout
POST /tenants/{tenantId}/uploads
{
"items": [
{
"filename": "someLogo",
"filenameWithExtension": "someLogo.ext",
"payload": "base64encodedString"
},
{
"filename": "toysRus",
"filenameWithExtension": "toysRus.ru",
"payload": "base64encodedString"
}
]
}
// Option two: request a presigned url for uploads
// Pros: one url to use to upload to S3 directly, no timeouts involved
// Cons: requires 3 network trips for uploads to be done
POST /tenants/{tenantId}/presignedUrl
{
"use": ["download"|"delete"|"upload"],
"item": {
"filename": "toysRus",
"filenameWithExtension": "toysRus.ru",
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment