Skip to content

Commit

Permalink
chore: Update max buffer size for file uploads to 20MB (#701)
Browse files Browse the repository at this point in the history
  • Loading branch information
darkdeathoriginal authored Aug 5, 2024
1 parent ecb522e commit 6ec4e4b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gramjs/client/uploads.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ const LARGE_FILE_THRESHOLD = 10 * 1024 * 1024;
const UPLOAD_TIMEOUT = 15 * 1000;
const DISCONNECT_SLEEP = 1000;
const BUFFER_SIZE_2GB = 2 ** 31;
const BUFFER_SIZE_20MB = 20 * 1024 * 1024;

async function getFileBuffer(
file: File | CustomFile,
Expand Down Expand Up @@ -128,7 +129,7 @@ export async function uploadFile(
const buffer = await getFileBuffer(
file,
size,
fileParams.maxBufferSize || BUFFER_SIZE_2GB - 1
fileParams.maxBufferSize || BUFFER_SIZE_20MB - 1
);

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

0 comments on commit 6ec4e4b

Please sign in to comment.