From d5e81d6c0a785c668c65ba51c9157c388529f823 Mon Sep 17 00:00:00 2001 From: Roy van Kaathoven Date: Sat, 1 Nov 2014 17:12:33 +0100 Subject: [PATCH] added documentation for uploadMethod and customResponseParser --- README.md | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f220aef..4da49c7 100644 --- a/README.md +++ b/README.md @@ -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(). @@ -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 *