Change image upload input name and not make duplicate of file in data.

TNL-2052
This commit is contained in:
Usman Khalid
2015-04-22 22:38:52 +05:00
committed by cahrens
parent a0feb2118b
commit e82735f79d
2 changed files with 2 additions and 2 deletions

View File

@@ -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();

View File

@@ -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>