Change image upload input name and not make duplicate of file in data.
TNL-2052
This commit is contained in:
@@ -583,6 +583,7 @@
|
||||
render: function () {
|
||||
this.$el.html(this.template({
|
||||
id: this.options.valueAttribute,
|
||||
inputName: (this.options.inputName || 'file'),
|
||||
imageUrl: _.result(this, 'imageUrl'),
|
||||
imageAltText: _.result(this, 'imageAltText'),
|
||||
uploadButtonIcon: _.result(this, 'iconUpload'),
|
||||
@@ -679,7 +680,6 @@
|
||||
|
||||
fileSelected: function (e, data) {
|
||||
if (_.isUndefined(data.files[0].size) || this.validateImageSize(data.files[0].size)) {
|
||||
data.formData = {file: data.files[0]};
|
||||
this.setCurrentStatus('uploading');
|
||||
this.setRemoveButtonVisibility('none');
|
||||
this.showUploadInProgressMessage();
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<label class="u-field-upload-button">
|
||||
<span class="upload-button-icon" aria-hidden="true"><%= uploadButtonIcon %></span>
|
||||
<span class="upload-button-title" aria-live="polite"><%= uploadButtonTitle %></span>
|
||||
<input class="upload-button-input" type="file" name="<%= id %>"/>
|
||||
<input class="upload-button-input" type="file" name="<%= inputName %>"/>
|
||||
</label>
|
||||
<button class="upload-submit" type="button" hidden="true"><%= uploadButtonTitle %></button>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user