aboutsummaryrefslogtreecommitdiff
path: root/src/client/Network.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/Network.ts')
-rw-r--r--src/client/Network.ts11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/client/Network.ts b/src/client/Network.ts
index a222b320f..996eb35d8 100644
--- a/src/client/Network.ts
+++ b/src/client/Network.ts
@@ -30,6 +30,17 @@ export namespace Networking {
if (!files.length) {
return [];
}
+ const maxFileSize = 50000000;
+ if (files.some(f => f.size > maxFileSize)) {
+ return new Promise<any>(res =>
+ res([
+ {
+ source: { name: '', type: '', size: 0, toJson: () => ({ name: '', type: '' }) },
+ result: { name: '', message: `max file size (${maxFileSize / 1000000}MB) exceeded` },
+ },
+ ])
+ );
+ }
files.forEach(file => formData.append(Utils.GenerateGuid(), file));
} else {
formData.append(Utils.GenerateGuid(), files);