Make normal files downloadable
This commit is contained in:
@@ -2403,13 +2403,17 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
|
||||
};
|
||||
|
||||
// FileManager API
|
||||
Client.prototype.filesGet = function (appId, path, callback) {
|
||||
get('/api/v1/apps/' + appId + '/files/' + path, null, function (error, data, status) {
|
||||
if (error) return callback(error);
|
||||
if (status !== 200) return callback(new ClientError(status, data));
|
||||
Client.prototype.filesGet = function (appId, path, download, callback) {
|
||||
if (download) {
|
||||
window.open(client.apiOrigin + '/api/v1/apps/' + appId + '/files/' + path + '?access_token=' + token);
|
||||
} else {
|
||||
get('/api/v1/apps/' + appId + '/files/' + path, null, function (error, data, status) {
|
||||
if (error) return callback(error);
|
||||
if (status !== 200) return callback(new ClientError(status, data));
|
||||
|
||||
callback(null, data);
|
||||
});
|
||||
callback(null, data);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Client.prototype.filesRemove = function (appId, path, callback) {
|
||||
|
||||
Reference in New Issue
Block a user