Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 230614

Ionic camera upload AWS3 - File transfer deprecated

$
0
0

If you use the new amplify api from AWS, it is a lot cleaner and they handle the configuration for you.

https://aws-amplify.github.io/amplify-js/media/storage_guide.html

  async saveFile(_event) {
    console.log(_event);

    const files = _event.detail.target.files;
    const key = `${new Date().getTime()}:${files[0].name}`;
    Storage.put(key, files[0], {
      contentType: files[0].type,
      level: "private"
    })
      .then(result => console.log(result))
      .catch(err => console.log(err));
  }

My AWS Amplify project is here.


Viewing all articles
Browse latest Browse all 230614

Latest Images

Trending Articles



Latest Images