1.0.3 • Published 7 years ago

react-native-sf-bubble v1.0.3

Weekly downloads
1
License
ISC
Repository
-
Last release
7 years ago

react-native-sf-aliyun-oss

阿里云文件上传、下载

安装

  • npm install react-native-sf-aliyun-oss
  • npm install react-native-aliyun-oss-cp
  • react-native link react-native-aliyun-oss-cp

Methods

MethodsParamsParam TypesdescriptionExample
configconfigobject阿里云配置参数参考例子
uploadfolder/filePath/ext/progress/suc/failstring/string/string/func/func/func上传文件参考例子
downLoadfilePath/progress/suc/failstring/func/func/func下载文件参考例子

例子

import SFAliyunOss from 'react-native-sf-aliyun-oss';

//配置一次
const config = {
    AccessKey: '阿里云的AccessKey',
    SecretKey: '阿里云的SecretKey',
    SecretToken: '阿里云的SecretToken',
    endPoint: '阿里云的endPoint',
    bucketName: '阿里云的bucketName'
  }
SFAliyunOss.config(config)
//文件上传
SFAliyunOss.upload('阿里云文件目录','上传文件的地址','文件后缀名',(progress)=>{},(fileKey)=>{},(err)=>{})
//多文件上传
SFAliyunOss.upload('阿里云文件目录',[{filePath:'',ext:'png'},{filePath:'',ext:'png'}],(progress)=>{},(fileKeys)=>{},(err)=>{})
//文件下载
SFAliyunOss.downLoad('阿里云文件地址',(progress)=>{},(filePath)=>{},(err)=>{})