Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File Size Mismatch After 100MB Uploading via nodejs using GramJS #706

Open
kkm opened this issue Aug 8, 2024 · 0 comments
Open

File Size Mismatch After 100MB Uploading via nodejs using GramJS #706

kkm opened this issue Aug 8, 2024 · 0 comments

Comments

@kkm
Copy link

kkm commented Aug 8, 2024

When uploading files via the client.sendFile() function in GramJS on Node.js, there's a discrepancy in file size between the uploaded file and the downloaded file. Files uploaded directly through a web browser maintain their original size upon download, but files uploaded using GramJS show a size increase.

  1. Use GramJS's client.sendFile() to upload a file.
const result = await client.sendFile("me",
  {
    file: 'Telegram_04.zip',
    progressCallback: (downloadedBytes) => {
      console.log(`Upload: ${Math.floor(downloadedBytes * 100)}%`);
    },
    forceDocument: true
  })
console.log(result.media.document);
  1. Download the file and check the file size.
  2. Observe the size difference between the original and downloaded file.

image
Direct browser uploads and downloads maintain file integrity, but uploads through GramJS's client show discrepancies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant