1.0.0 • Published 3 years ago

danae-file-upload v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

init

npm install danae-file-upload

use

html

<input type="file" id="file" />
<button id="upload">upload</button>

js

import { fileUpload } from 'danae-file-upload';
document.getElementById('upload').addEventListener('click', function() {
    fileUpload({
        url: '/xxx/xxx/xxx',
        formName: 'file',// default
        method: 'POST', // default
        files: document.getElementById('file').files,
        headers: () => ({ /*...*/ }),
        data: () => ({ /*...*/ }),
        uploadEnd: () => {

        },
        finish: () => {
        
        },
    });
}, false);
1.0.0

3 years ago