Skip to content

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

fix file upload s3

sytolk88c6d55c498c
diff --git a/app/reducers/io-actions.ts b/app/reducers/io-actions.ts
index ee7d12da7..b60195d55 100644
--- a/app/reducers/io-actions.ts
+++ b/app/reducers/io-actions.ts
@@ -214,7 +214,7 @@ const actions = {
reader.onload = async (event: any) => {
await readerLoaded(event, inx, filePath);
};
- if (AppConfig.isWeb) {
+ if (AppConfig.isWeb && PlatformIO.isMinio()) {
reader.readAsBinaryString(file);
} /* else if (AppConfig.isCordova) {
reader.readAsDataURL(file);
diff --git a/app/services/platform-io.ts b/app/services/platform-io.ts
index 7117ef6f6..59b47c5af 100644
--- a/app/services/platform-io.ts
+++ b/app/services/platform-io.ts
@@ -67,6 +67,9 @@ export default class PlatformIO {
static haveObjectStoreSupport = (): boolean => objectStoreAPI !== undefined;
+ static isMinio = (): boolean =>
+ objectStoreAPI !== undefined && objectStoreAPI.config.endpointURL;
+
static getDirSeparator = (): string => // TODO rethink usage for S3 on Win
PlatformIO.haveObjectStoreSupport() ? '/' : AppConfig.dirSeparator;