Skip to content

Commit

Permalink
added documentation for uploadMethod and customResponseParser
Browse files Browse the repository at this point in the history
  • Loading branch information
Roy van Kaathoven committed Nov 1, 2014
1 parent bdfe96c commit d5e81d6
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ All versions can be configured using the following options:
/**
* When a file has succesfully been uploaded
*
* @param {Object} json JSON data returned from the server
* @param {Object} response By default JSON data, or the result of customResponseParser if implemented
*/
onUploadedFile: function(json) {},
onUploadedFile: function(response) {},

/**
* Custom error handler. Runs after removing the placeholder text and before the alert().
Expand All @@ -101,6 +101,23 @@ All versions can be configured using the following options:
*/
customUploadHandler: function(file) { return true; }

/**
* Parse the response before passing it to onUploadedFile
*
* @param {XMLHttpRequest} xhr XMLHttpRequest result
* @return {Object} custom result
*/
customReponseParser: function(xhr) {
return false;
},

/**
* HTTP method that is used to send data to the uploadUrl
*
* @type {String}
*/
uploadMethod: 'POST',

/**
* Data processor after upload a file
*
Expand Down

0 comments on commit d5e81d6

Please sign in to comment.