Skip to content

Commit 6ec4e4b

Browse files
chore: Update max buffer size for file uploads to 20MB (#701)
1 parent ecb522e commit 6ec4e4b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

gramjs/client/uploads.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ const LARGE_FILE_THRESHOLD = 10 * 1024 * 1024;
9595
const UPLOAD_TIMEOUT = 15 * 1000;
9696
const DISCONNECT_SLEEP = 1000;
9797
const BUFFER_SIZE_2GB = 2 ** 31;
98+
const BUFFER_SIZE_20MB = 20 * 1024 * 1024;
9899

99100
async function getFileBuffer(
100101
file: File | CustomFile,
@@ -128,7 +129,7 @@ export async function uploadFile(
128129
const buffer = await getFileBuffer(
129130
file,
130131
size,
131-
fileParams.maxBufferSize || BUFFER_SIZE_2GB - 1
132+
fileParams.maxBufferSize || BUFFER_SIZE_20MB - 1
132133
);
133134

134135
// Make sure a new sender can be created before starting upload

0 commit comments

Comments
 (0)