From 89379b527dfb8442e4abbd588bf8f00dd838eae8 Mon Sep 17 00:00:00 2001 From: Joe Vu Date: Tue, 18 Mar 2014 09:32:38 -0700 Subject: [PATCH] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b71528b..c7e9b7a 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ Backbone.Model File Upload ========================== -A concise, non-iframe, & pure XHR2/AJAX Backbone.model file upload. +A concise, non-iframe, & pure XHR2/AJAX Backbone.model file upload. (Good for IE >= 9, FF, Chrome.) -This plugin upgrades the current `save` method to be able to upload files. +This plugin upgrades the current `save` method to be able to upload files using the HTML5's File API and FormData class. NOTE: This plugin will require deep parsing in the back-end since it won't be using a JSON object. In other words, your normal JSON serialization won't work here. It will convert the model to a key/value pattern. Model will be flattened on request. @@ -18,7 +18,7 @@ model.save({}, [options]) ### save & set #### model.save( [file attribute], [file object], [options] ) #### model.set( [file attribute], [file object], [options] ) -In terms of how to use these methods, they have not changed. The only difference is that it has the capability to take a File object grabbed from the DOM (i.e. ``). As the file is being uploaded, a trigger `progress` is being sent as the browser sends chunks of data. The `progress` trigger sends a progress status in percents. +In terms of how to use these methods, they have not changed. The only difference is that it has the capability to take a File object grabbed from the DOM (i.e. ``). As the file is being uploaded, a trigger `progress` fires as the browser sends chunks of data. The `progress` trigger sends a progress status in percents. ```js var fileObject = $(':input[type="file"]')[0].files[0];