Open different mimetypes differently in filemanager
This commit is contained in:
@@ -2414,9 +2414,16 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
|
||||
};
|
||||
|
||||
// FileManager API
|
||||
Client.prototype.filesGet = function (appId, path, download, callback) {
|
||||
if (download) {
|
||||
// mode can be 'download', 'open', 'link' or 'data'
|
||||
Client.prototype.filesGet = function (appId, path, mode, callback) {
|
||||
if (mode === 'download') {
|
||||
window.open(client.apiOrigin + '/api/v1/apps/' + appId + '/files/' + path + '?download=true&access_token=' + token);
|
||||
callback(null);
|
||||
} else if (mode === 'open') {
|
||||
window.open(client.apiOrigin + '/api/v1/apps/' + appId + '/files/' + path + '?download=false&access_token=' + token);
|
||||
callback(null);
|
||||
} else if (mode === 'link') {
|
||||
callback(null, client.apiOrigin + '/api/v1/apps/' + appId + '/files/' + path + '?download=false&access_token=' + token);
|
||||
} else {
|
||||
function responseHandler(data, headers, status) {
|
||||
if (headers()['content-type'] && headers()['content-type'].indexOf('application/json') !== -1) return JSON.parse(data);
|
||||
|
||||
Reference in New Issue
Block a user