PHOTO_EXT_INVALID when sending photos from buffer #45

Closed
opened 2024-04-13 17:59:40 +03:00 by teidesu · 0 comments
teidesu commented 2024-04-13 17:59:40 +03:00 (Migrated from github.com)

To Reproduce

const buffer = Buffer.from(b64, 'base64')
const photo = InputMedia.photo(buffer)
const phtemp = await tg.uploadMedia(photo)

Expected behavior

works fine

Environment

  • OS: [e.g. windows]
  • Runtime: [e.g. Node 18.12.1, Chrome 97.0.0]
  • mtcute version: [e.g. 0.1.0]

Additional context

for some reason mime is not enough and we should also provide a valid file extension for that mime

## To Reproduce ```ts const buffer = Buffer.from(b64, 'base64') const photo = InputMedia.photo(buffer) const phtemp = await tg.uploadMedia(photo) ``` ## Expected behavior works fine ## Environment - OS: [e.g. windows] - Runtime: [e.g. Node 18.12.1, Chrome 97.0.0] - mtcute version: [e.g. 0.1.0] **Additional context** for some reason mime is not enough and we should also provide a valid file extension for that mime
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: teidesu/mtcute#45
No description provided.