diff --git a/res/static/script/Toolbar.js b/res/static/script/Toolbar.js index 677850e..6a6f848 100644 --- a/res/static/script/Toolbar.js +++ b/res/static/script/Toolbar.js @@ -1,8 +1,8 @@ -/* +/* * Time for a more Java-like approach. - * + * * Feel free to use this of course - * + * * Made by Fornax */ @@ -36,13 +36,13 @@ var Toolbar = { } }, download: function () { - $("#frmDownload").attr("src", "/api/file/" + Viewer.currentFile + "/download"); + $("#frmDownload").attr("src", "/api/file/" + Viewer.currentFile + "?download"); }, downloadList: function(){ if(!Viewer.isList){ return; } - + $("#frmDownload").attr("src", "/api/list/" + Viewer.listId + "/zip"); }, copyUrl: function () { @@ -59,7 +59,7 @@ var Toolbar = { $("#btnCopy>span").text("Error!"); alert("Your browser does not support copying text."); } - + // Return to normal setTimeout(function(){ $("#btnCopy>span").text("Copy"); diff --git a/res/template/apidoc.html b/res/template/apidoc.html index 20908a2..cef14a0 100644 --- a/res/template/apidoc.html +++ b/res/template/apidoc.html @@ -70,7 +70,6 @@
+ When '?download' is added to the URL the server will send an + attachment header instead of inline rendering, which causes the + browser to show a 'Save File' dialog. +
URL | ID of the file to request | ||
download | +false | +URL | +Sends file attachment instead of inline | +
- Same as GET /file/{id}, but with File Transfer HTTP - headers. Will trigger a save file dialog when opened in - a web browser. Also supports byte range requests. -
-