|
@@ -214,9 +214,9 @@ class FileBrowserModel implements IDisposable {
|
|
|
download(path: string): Promise<IContents.IModel> {
|
|
|
let normalizePath = Private.normalizePath;
|
|
|
path = normalizePath(this._model.path, path);
|
|
|
- return this._manager.contents.get(path, { content: true }).then(contents => {
|
|
|
+ return this._manager.contents.get(path, { content: true, type: 'file', format: 'base64' }).then(contents => {
|
|
|
let element = document.createElement('a');
|
|
|
- element.setAttribute('href', 'data:text/text;charset=utf-8,' + encodeURI(contents.content));
|
|
|
+ element.setAttribute('href', `data:${contents.mimetype};base64,${contents.content}`);
|
|
|
element.setAttribute('download', contents.name);
|
|
|
element.click();
|
|
|
return contents;
|