diff --git a/src/asset_manager/config/config.js b/src/asset_manager/config/config.js index 09bbace76..39e351ff3 100644 --- a/src/asset_manager/config/config.js +++ b/src/asset_manager/config/config.js @@ -63,7 +63,7 @@ module.exports = { // } uploadFile: '', - // In the absence of uploadFile function assets will be embedded as Base64 + // In the absence of 'uploadFile' or 'upload' assets will be embedded as Base64 embedAsBase64: 1, // Handle the image url submit from the built-in 'Add image' form diff --git a/src/asset_manager/view/FileUploader.js b/src/asset_manager/view/FileUploader.js index 5130a7f26..0258fdf48 100644 --- a/src/asset_manager/view/FileUploader.js +++ b/src/asset_manager/view/FileUploader.js @@ -32,7 +32,7 @@ module.exports = Backbone.View.extend( if (uploadFile) { this.uploadFile = uploadFile.bind(this); - } else if (c.embedAsBase64) { + } else if (!c.upload && c.embedAsBase64) { this.uploadFile = this.constructor.embedAsBase64; } @@ -137,11 +137,10 @@ module.exports = Backbone.View.extend( headers, body }) - .then( - res => - ((res.status / 200) | 0) == 1 - ? res.text() - : res.text().then(text => Promise.reject(text)) + .then(res => + ((res.status / 200) | 0) == 1 + ? res.text() + : res.text().then(text => Promise.reject(text)) ) .then(text => this.onUploadResponse(text, clb)) .catch(err => this.onUploadError(err));