Skip to content

Commit 29cf5f4

Browse files
Merge remote-tracking branch 'remotes/github/MAGETWO-96407' into EPAM-PR-30
2 parents 0744fa9 + b791659 commit 29cf5f4

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

lib/web/mage/dataPost.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ define([
5757
*/
5858
postData: function (params) {
5959
var formKey = $(this.options.formKeyInputSelector).val(),
60-
$form;
60+
$form, input;
6161

6262
if (formKey) {
6363
params.data['form_key'] = formKey;
@@ -67,6 +67,19 @@ define([
6767
data: params
6868
}));
6969

70+
if (params.files) {
71+
$form[0].enctype = 'multipart/form-data';
72+
$.each(params.files, function (key, files) {
73+
if (files instanceof FileList) {
74+
input = document.createElement('input');
75+
input.type = 'file';
76+
input.name = key;
77+
input.files = files;
78+
$form[0].appendChild(input);
79+
}
80+
});
81+
}
82+
7083
if (params.data.confirmation) {
7184
uiConfirm({
7285
content: params.data.confirmationMessage,

0 commit comments

Comments
 (0)