Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
uploads with 'click to upload' and 'drop to upload' support
JavaScript
branch: master

This branch is 20 commits ahead, 5 commits behind component:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
src
test
.gitignore
.jshintrc
.tern-project
component.json
license
readme.md

readme.md

cdpload

uploads with click to upload and drop to upload support

install

component install ramitos/cdpload

api

var cdpload = require('cdpload');

var upload_handler = cdpload(document.getElementById('el'), {
  multiple: false, // only accept one file. default: true
  accept: 'image/*', // also accepts ['image/*', 'video/*']. default: '*/*'
  maxSize: 90000 // default: Infinity
})

upload_handler.on('error', function (err) {})
upload_handler.on('typeNotAllowed', function (file) {})
upload_handler.on('maxSizeExceed', function (file) {})

upload_handler.on('upload', function (upload) {
  upload.to('/upload', function (err, req) {})
  upload.on('progress', function (ev) {})
  upload.on('end', function (req) {})
  upload.emit('abort', function (ev) {})
  upload.emit('error', function (err) {})
})

license

MIT

Something went wrong with that request. Please try again.