Skip to content
This repository was archived by the owner on Jan 24, 2019. It is now read-only.

Commit f30c359

Browse files
committed
Merge pull request #401 from zivperry/ui-uploader-data
Ability to add data to query via ``options.data``
2 parents 9ed11dd + de584c7 commit f30c359

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

modules/uploader/uploader.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function uiUploader($log) {
3737
}
3838
if (self.files[i].active)
3939
continue;
40-
ajaxUpload(self.files[i], self.options.url);
40+
ajaxUpload(self.files[i], self.options.url, self.options.data);
4141
}
4242
}
4343

@@ -64,9 +64,10 @@ function uiUploader($log) {
6464
return (bytes / Math.pow(1024, i)).toFixed(i ? 1 : 0) + ' ' + sizes[isNaN(bytes) ? 0 : i + 1];
6565
}
6666

67-
function ajaxUpload(file, url) {
68-
var xhr, formData, prop, data = '',
69-
key = '' || 'file';
67+
function ajaxUpload(file, url, data) {
68+
var xhr, formData, prop, key = '' || 'file';
69+
data = data || {};
70+
7071
self.activeUploads += 1;
7172
file.active = true;
7273
xhr = new window.XMLHttpRequest();

0 commit comments

Comments
 (0)