File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -336,6 +336,7 @@ module.exports = function(AV) {
336336 } else if ( typeof ( File ) !== "undefined" && data instanceof File ) {
337337 this . _source = readAsync ( data , type ) ;
338338 this . _isFileObject = true ;
339+ this . _fileObject = data ;
339340 } else if ( AV . _isNode && global . Buffer . isBuffer ( data ) ) {
340341 // use global.Buffer to prevent browserify pack Buffer module
341342 this . _source = AV . Promise . as ( data . toString ( 'base64' ) , guessedType ) ;
@@ -545,7 +546,7 @@ module.exports = function(AV) {
545546 * @param {Object } options A Backbone-style options object.
546547 * @return {AV.Promise } Promise that is resolved when the save finishes.
547548 */
548- save : function ( ) {
549+ save : function ( ) {
549550 var options = null ;
550551 var saveOptions = { } ;
551552 if ( arguments . length === 1 ) {
@@ -561,7 +562,7 @@ save: function() {
561562 // TODO: remove this code and use qiniu SDK
562563 var dataFormat ;
563564 self . _previousSave = self . _source . then ( function ( data , type ) {
564- dataFormat = data ;
565+ dataFormat = self . _fileObject || data ;
565566 return self . _qiniuToken ( type ) ;
566567 } ) . then ( function ( response ) {
567568 self . _url = response . url ;
You can’t perform that action at this time.
0 commit comments