mirror of
https://github.com/mickael-kerjean/filestash
synced 2025-12-28 03:05:35 +01:00
fix (zip): single file download when the selected file is a folder
This commit is contained in:
parent
10b5438f48
commit
facebea92f
1 changed files with 2 additions and 4 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in a new issue