cre-file-upload
v1.0.1
Published
cre-file-upload
Downloads
6
Keywords
Readme
cre-file-upload 阿里云文件上传
Install
npm i cre-file-upload
# or
yarn add cre-file-upload
Usage
import { compressFile, uploadFile } from 'cre-file-upload'
// 异步方法,需要使用async-await或Promise
/**
* 压缩文件
* @param {File} file 目标文件
* @return {File} 压缩结果文件
*/
compressFile(file)
/**
* 上传文件
* @param {Object} ossInfo OSS配置
* @param {Object} aliyunInfo 阿里云配置
* @param {File} file 目标文件
*/
uploadFile(ossInfo, aliyunInfo, file)