Skip to content

tiny-qiniu for rc-upload or antd upload component `customRequest` property

License

Notifications You must be signed in to change notification settings

die-welle/tiny-qiniu-request

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tiny-qiniu-request

tiny-qiniu for rc-upload or antd upload component customRequest property.

Installation

yarn add tiny-qiniu tiny-qiniu-request

Usage

tiny-qiniu-request should work together with rc-upload or antd upload component

import React, { Component } from 'react';
import { Upload } from 'antd';
import tinyQiniuRequest from 'tiny-qiniu-request';

const request = tinyQiniuRequest({
    name: 'my_bucket', // qiniu bucket name, requried
    domain: 'http://cdn.awesome.com', // qiniu bucket domain, requried
    uptokenUrl: 'http://localhost/api/uptoken',
});

export default class MyUpload extends {
    render() {
        <Upload
            customRequest={request}
            // {...other}
        />
    }
}
Signature

tinyQiniuRequest(option)

The option usage is the same with tiny-qiniu constructor option

Related Projects

License

MIT

Releases

No releases published

Packages

No packages published