Skip to content

Commit 1b3af7a

Browse files
authored
Merge pull request mailru#424 from mailru/method-fix
v2.1.0: Add settings for upload method
2 parents d957342 + 3f49742 commit 1b3af7a

File tree

9 files changed

+41
-13
lines changed

9 files changed

+41
-13
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,20 @@ var xhr = FileAPI.upload({
371371

372372
---
373373

374+
<a name="options.uploadMethod"></a>
375+
### uploadMethod`:String`
376+
Request method, HTML5 only.
377+
378+
```js
379+
var xhr = FileAPI.upload({
380+
url: '...',
381+
uploadMethod: 'PUT',
382+
files: { .. },
383+
});
384+
```
385+
386+
---
387+
374388
<a name="options.headers"></a>
375389
### headers`:Object`
376390
Additional request headers, HTML5 only.

README.ru.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,19 @@ var xhr = FileAPI.upload({
365365
});
366366
```
367367

368+
---
369+
<a name="options.uploadMethod"></a>
370+
### uploadMethod`:String`
371+
Метод запроса, только HTML5.
372+
373+
```js
374+
var xhr = FileAPI.upload({
375+
url: '...',
376+
uploadMethod: 'PUT',
377+
files: { ... },
378+
});
379+
```
380+
368381
---
369382

370383
<a name="options.headers"></a>

dist/FileAPI.html5.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! FileAPI 2.0.26 - BSD | git://github.com/mailru/FileAPI.git
1+
/*! FileAPI 2.1.0 - BSD | git://github.com/mailru/FileAPI.git
22
* FileAPI — a set of javascript tools for working with files. Multiupload, drag'n'drop and chunked file upload. Images: crop, resize and auto orientation by EXIF.
33
*/
44

@@ -287,7 +287,7 @@
287287
* FileAPI (core object)
288288
*/
289289
api = {
290-
version: '2.0.26',
290+
version: '2.1.0',
291291

292292
cors: false,
293293
html5: true,
@@ -2999,7 +2999,7 @@
29992999
url += (url.indexOf('?') < 0 ? "?" : "&") + data.params.join("&");
30003000
}
30013001

3002-
xhr.open('POST', url, true);
3002+
xhr.open(options.uploadMethod || 'POST', url, true);
30033003

30043004
if( api.withCredentials ){
30053005
xhr.withCredentials = "true";

dist/FileAPI.html5.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/FileAPI.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! FileAPI 2.0.26 - BSD | git://github.com/mailru/FileAPI.git
1+
/*! FileAPI 2.1.0 - BSD | git://github.com/mailru/FileAPI.git
22
* FileAPI — a set of javascript tools for working with files. Multiupload, drag'n'drop and chunked file upload. Images: crop, resize and auto orientation by EXIF.
33
*/
44

@@ -287,7 +287,7 @@
287287
* FileAPI (core object)
288288
*/
289289
api = {
290-
version: '2.0.26',
290+
version: '2.1.0',
291291

292292
cors: false,
293293
html5: true,
@@ -2999,7 +2999,7 @@
29992999
url += (url.indexOf('?') < 0 ? "?" : "&") + data.params.join("&");
30003000
}
30013001

3002-
xhr.open('POST', url, true);
3002+
xhr.open(options.uploadMethod || 'POST', url, true);
30033003

30043004
if( api.withCredentials ){
30053005
xhr.withCredentials = "true";

dist/FileAPI.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/FileAPI.XHR.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@
198198
url += (url.indexOf('?') < 0 ? "?" : "&") + data.params.join("&");
199199
}
200200

201-
xhr.open('POST', url, true);
201+
xhr.open(options.uploadMethod || 'POST', url, true);
202202

203203
if( api.withCredentials ){
204204
xhr.withCredentials = "true";

lib/FileAPI.core.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@
193193
* FileAPI (core object)
194194
*/
195195
api = {
196-
version: '2.0.26',
196+
version: '2.1.0',
197197

198198
cors: false,
199199
html5: true,

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
{
22
"name": "fileapi",
33
"exportName": "FileAPI",
4-
"version": "2.0.27",
4+
"version": "2.1.0",
55
"devDependencies": {
66
"connect-busboy": "~0.0.2",
77
"eventemitter2": "~0.4.13",
88
"express": "~4.12.3",
9+
"flex-sdk": "^4.6.0-0",
910
"grunt": "^0.4.5",
1011
"grunt-contrib-compress": "~0.9.1",
1112
"grunt-contrib-concat": "~0.4.0",

0 commit comments

Comments
 (0)