Skip to content

Commit ec1d801

Browse files
committed
+ formData option;
1 parent 48c5d64 commit ec1d801

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

lib/FileAPI.Form.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*global window, navigator, FileAPI */
1+
/*global window, FileAPI */
22

33
(function (api, window){
44
"use strict";
@@ -8,7 +8,6 @@
88
, FormData = window.FormData
99
, Form = function (){ this.items = []; }
1010
, encodeURIComponent = window.encodeURIComponent
11-
, isPhantomJS = /phantomjs/i.test(navigator.userAgent)// @todo: fixed it
1211
;
1312

1413

@@ -39,7 +38,7 @@
3938
api.log('FileAPI.Form.toHtmlData');
4039
this.toHtmlData(fn);
4140
}
42-
else if( isPhantomJS || this.multipart || !FormData ){
41+
else if( !api.formData || this.multipart || !FormData ){
4342
api.log('FileAPI.Form.toMultipartData');
4443
this.toMultipartData(fn);
4544
}

lib/FileAPI.core.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@
188188
cors: false,
189189
html5: true,
190190
media: false,
191+
formData: true,
191192

192193
debug: false,
193194
pingUrl: false,

tests/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
html5: true
1212
, debug: false
1313
, staticPath: '../dist/'
14+
, formData: !/phantomjs/i.test(navigator.userAgent)
1415
};
1516
</script>
1617

0 commit comments

Comments
 (0)