我需要简单的一步一步指令,将文件从我的本地存储(路径中的静态文件)上传到IONIC 2中的AWS S3存储桶。我已经搜索过像cordova文件传输这样的插件,但是无法找到合适的插件从离子2 app上传到s3的解决方案。
答案 0 :(得分:0)
Ionic2提供FileTransfer
上传图片。要使用它应该安装此插件
$ ionic cordova plugin add cordova-plugin-file-transfer
$ npm install --save @ionic-native/file-transfer
然后配置上传:
key: [key value is configured from frontend],
AWSAccessKeyId: [AWSAccessKeyId value received from backend],
acl: [acl value received from backend],
policy: [policy value received from backend],
signature: [signature value received from backend],
这是我的博客https://mymai91.github.io/ionic/2017/09/17/upload-image-to-s3-using-ionic2.html您可以查看详细信息(包括代码示例)