jp-jquery-upload

1.0.3 • Public • Published

jp-jquery-upload

npm package jquery upload

Install

npm install --save jp-jquery-upload

Usage

import $ from 'jquery';
import upload from 'jp-jquery-upload';
 
$.upload( '/upload.php', new FormData( $("#formUpload")[0] ))
  .progress( function( progressEvent, upload) {
    if( progressEvent.lengthComputable) {
      var percent = Math.round( progressEvent.loaded * 100 / progressEvent.total);
      if( upload) {
        console.log( percent + '% uploaded');
      } else {
        console.log( percent + '% downloaded');
      }
    }
  })
  .fail(function(){
    console.log('error');
  })
  .done( function(res) {
    console.log('successfull');
  });
          

Readme

Keywords

none

Package Sidebar

Install

npm i jp-jquery-upload

Weekly Downloads

1

Version

1.0.3

License

none

Last publish

Collaborators

  • chusan