Skip to content

Commit

Permalink
can handle application/json content type upon "download" operation #270
Browse files Browse the repository at this point in the history
  • Loading branch information
psolom committed Dec 18, 2017
1 parent 774b3b7 commit 15d35b0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions scripts/filemanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -4136,10 +4136,11 @@ $.richFilemanagerPlugin = function(element, pluginOptions)

$.fileDownload(buildConnectorUrl(queryParams), {
failCallback: function (responseHtml, url, error) {
var responseJSON = $.parseJSON(responseHtml);
var message = $(responseHtml).text();
var messageJSON = $.parseJSON(message);

if ($.isPlainObject(responseJSON) && responseJSON.errors) {
handleJsonErrors(responseJSON.errors);
if ($.isPlainObject(messageJSON) && messageJSON.errors) {
handleJsonErrors(messageJSON.errors);
}
}
});
Expand Down
2 changes: 1 addition & 1 deletion scripts/filemanager.min.js

Large diffs are not rendered by default.

0 comments on commit 15d35b0

Please sign in to comment.