uploadcare-multi-upload

1.0.0 • Public • Published

uploadcare-multi-upload

Upload multiple images at once with Uploadcare REST API.

Install

npm install uploadcare-multi-upload --save

Usage

Grab your public and secret keys from project's page.

import uploadcareMultiUpload from 'uploadcare-multi-upload'
 
const multiUpload = uploadcareMultiUpload('YOUR_PUBLIC_KEY', 'YOUR_SECRET_KEY')
const images = [
    {
        id: 1,
        src: 'http://placekitten.com/300/200',
    },
    {
        id: 2,
        src: 'http://placekitten.com/600/400',
    },
]
const onSuccessUpload = (image) => {
    console.log(JSON.stringify(image))
}
 
const onFailUpload = (image, error) => {
    console.log('error ', image, error)
}
 
multiUpload.fromUrls(images, 'src', onSuccessUpload, onFailUpload)
        .then(() => console.log('All images uploaded')

Dependencies (1)

Dev Dependencies (8)

Package Sidebar

Install

npm i uploadcare-multi-upload

Weekly Downloads

0

Version

1.0.0

License

MIT

Last publish

Collaborators

  • eadidenko
  • rsedykh
  • uploadcare-user
  • nd0ut