Skip to content

TagSpaces is an offline, open source, document manager with tagging support

fixing broken download functionality on s3 locations

Ilian Sapundshiev015be238f37c
diff --git a/app/components/EntryContainer.js b/app/components/EntryContainer.js
index 71fbe3990..a719ee52f 100644
--- a/app/components/EntryContainer.js
+++ b/app/components/EntryContainer.js
@@ -706,11 +706,12 @@ class EntryContainer extends React.Component<Props, State> {
downloadLink.setAttribute('href', `file:///${currentEntry.path}`);
}
- if (currentEntry.url) {
+ if (currentEntry.url) { // mostly the s3 case
+ downloadLink.setAttribute('target', '_blank');
downloadLink.setAttribute('href', currentEntry.url);
}
- downloadLink.setAttribute('download', fileName);
+ downloadLink.setAttribute('download', fileName); // works only for same origin
downloadLink.click();
}
}}