One click file uploader
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
src
.eslintrc
.gitignore
.jshintrc
LICENSE
README.md
package-lock.json
package.json
webpack.config.js

README.md

codex.transport

One click file uploader

Usage

transport.init({
   url: '/ajax/transport',
   multiple: true,
   accept: 'image/*',
   data: {},
   before: function () {},
   progress: function (percentage) {
       console.log(percentage + '%');
       // ...
   },
   success: function (response) {
       console.log(response);
       // ...
   },
   error: function (response) {
       console.log(response);
       // ...
   },
   after: function () {},
});

You can handle all of this event like:

  • what should happen before data sending with XMLHTTP
  • what should after success request
  • error handler