Web Component: j-Upload


  • Info
  • HTML
  • JS
  • CSS
  • Meta

j-Upload

The component can perform uploading of files.

  • easy and universal usage
  • singleton

Methods:

var opt = {};

// Restricts files according to the content-type
// opt.accept = 'image/*';

// Enables multiple files
// opt.multiple = true;

// IMPORTANT:
// URL address for uploading
opt.url = '/api/upload/';

// A callback
opt.callback = function(response) {

};

opt.error = function(err) {
    // Optional
    // Error handling
};

// Optional, additional request data
opt.data = {};
opt.data.fieldName1 = 'value';
opt.data.fieldName2 = 'value';

// Shows file browser
SETTER('upload', 'show', opt);

Files are uploaded with these names/keys in the form file1, file2, file..N.

Author