简体   繁体   中英

Appery.io aws S3 integration

Looking for help on how to have a appery.io ionic 5 app upload images, files, videos etc. to aws S3. I am using aws DynamoDB thru API Express successfully and can get a presigned S3 URL thru API Express as well. My problem is using the presigned URL to upload a image/file. Tried fetch, httpClient etc. Some Guidence would be greatly appreciated.

Thank you

To work with binary data in API Express you can do the following:

  • Create new service of Custom REST API type
  • In START node select POST method and Binary for request body
  • With that you should be able to select Binary request as parameter value in SQL node

The second part of the question is how can you get the binary data if you have fileUrl .

  • Import API Express service created on a previous step into your project with Create New > API Express service
  • On Code tab create a variable named buffer of type Any
  • On Data tab add datasource for the imported API Express service. In Before send mapping connect buffer with body.data
  • Drop the button on Screen1
  • Add event with TypeScript code to it:
fetch(fileUrl).then(res => res.arrayBuffer()).then(arrayBuffer => {
    this.buffer = arrayBuffer;
    this.Apperyio.execDataService(this, "myAexService");
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM