cordova-plugin-aliyun-ossupload

1.0.3 • Public • Published

阿里云文件操作插件

参考链接

https://help.aliyun.com/document_detail/31920.html

https://github.com/aliyun/aliyun-oss-ios-sdk

https://github.com/aliyun/aliyun-oss-android-sdk

安装命令

ionic cordova plugin add https://github.com/lounai-chen/cordova-plugin-aliyun-ossupload --variable SECRETKEY=xxxxxx --save

Android9.0以上是默认所有http请求的,需要在AndroidManifest.xml的application代码中配置如下

ndroid:usesCleartextTraffic="true"

使用案例关键代码

var _this = this;

var uploadurlfile = _this.temppath.substr(8,_this.temppath2.length - 8); //安卓路径要去掉file:///

alert(uploadurlfile)

this.xxxx.getOSSToken({},false).then(result => {

try{
 aliyunOSSupload.onOssNormalPut(
 
     (e) => {_this.onSuccess(e)},
     
     (e) =>{_this.onError(e)},
     
     result.data,
     
     'oss-cn-shenzhen.aliyuncs.com',
     
     'xxx',
     
     'mp3_20191115_152830.mp3',
     
      uploadurlfile,
      
     );

 }catch(e){alert(' error: '+e)}; 
);

Readme

Keywords

none

Package Sidebar

Install

npm i cordova-plugin-aliyun-ossupload

Weekly Downloads

1

Version

1.0.3

License

ISC

Unpacked Size

12.4 MB

Total Files

66

Last publish

Collaborators

  • bozhaohui
  • noah-lou-chen
  • monsterwolf
  • wlnj_tan