mirror of
https://github.com/mickael-kerjean/filestash.git
synced 2026-10-21 04:09:44 +00:00
fix (zip): single file download when the selected file is a folder
This commit is contained in:
@@ -175,11 +175,9 @@ class FileSystem {
|
||||
}
|
||||
|
||||
zip(paths) {
|
||||
let url;
|
||||
if (paths.length === 1) {
|
||||
let url = appendShareToUrl("/api/files/zip?" + paths.map((p) => "path=" + prepare(p)).join("&"));
|
||||
if (paths.length === 1 && filetype(paths[0]) === "file") {
|
||||
url = appendShareToUrl("/api/files/cat?path=" + prepare(paths[0]) + "&name=" + basename(paths[0]));
|
||||
} else {
|
||||
url = appendShareToUrl("/api/files/zip?" + paths.map((p) => "path=" + prepare(p)).join("&"));
|
||||
}
|
||||
window.open(url);
|
||||
return Promise.resolve();
|
||||
|
||||
Reference in New Issue
Block a user