Skip to content

cordova 插件, 封装阿里云 上传\下载\水印\缩放\ 文件插件

Notifications You must be signed in to change notification settings

CTY-Library/cordova-plugin-aliyun-ossupload

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

阿里云文件操作插件

参考链接

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)}; 
);

About

cordova 插件, 封装阿里云 上传\下载\水印\缩放\ 文件插件

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages