We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 0744fa9 + b791659 commit 29cf5f4Copy full SHA for 29cf5f4
lib/web/mage/dataPost.js
@@ -57,7 +57,7 @@ define([
57
*/
58
postData: function (params) {
59
var formKey = $(this.options.formKeyInputSelector).val(),
60
- $form;
+ $form, input;
61
62
if (formKey) {
63
params.data['form_key'] = formKey;
@@ -67,6 +67,19 @@ define([
67
data: params
68
}));
69
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
+
83
if (params.data.confirmation) {
84
uiConfirm({
85
content: params.data.confirmationMessage,
0 commit comments