Telegram: Send files using InputFile(binary data) [GOT CREATED]

As far as I know, you can send to the file to telegram not only with file_id or URL link to the file.
To send binary data according to the documentation, you need to use InputFile.

InputFile
This object represents the contents of a file to be uploaded. Must be posted using multipart/form-data in the usual way that files are uploaded via the browser.

Example Curl query:

curl --location --request POST 'https://api.telegram.org/bot-key/sendPhoto' \
--header 'Content-Type: application/json' \
--form 'photo=@"/home/image.png"' \
--form 'chat_id="chat_id"'

Can this feature be added to the following methods?

  • sendPhoto
  • sendDocument
  • sendAudio
  • sendVideo

Can you tell me how difficult it is to make this improvement?
Now I have to use S3 to send files, and it is very expensive.

I had a quick look and it’s not difficult. It’s most about available time.

إعجاب واحد (1)

Hi!
You can’t get it in the near future to refine it?

Keeping an S3 server to send files to the cart is quite wasteful…

@a1ekseev
Please consider these options: MinIO and Wasabi.

They both use S3 compatible API but MinIO is self hosted and Wasabi.com is about 80% cheaper than S3! with free egress. At last look It’s $5.99/TB/m

Wasabi is fantastic and super fast, MinIO is easy to setup and I believe Linode (and other providers) have one-click options for it, as well as their own S3 type storage called Object Storage (and an API).

I do not see the point of keeping a repository of files, just to send binary data to the chat telegram.

There could be another option…

@pemontto put this together the other day, it just needs to be checked and merged and you will be good to go: ✨ Add binary upload for Telegram by pemontto · Pull Request #2247 · n8n-io/n8n · GitHub

إعجابَين (2)

I just reviewed the PR that @Jon mentioned and made some changes. It will probably be available in the next release.

إعجاب واحد (1)

Thank you!
Very much looking forward to it.

Hey I had the same issue as you so wrote the PR. However as a workaround you can still perform the binary upload with an HTTP Request node. Try this:

4 إعجابات

Thanks very much for the contribution @pemontto. Good to see you here in the community.

إعجاب واحد (1)

Got released with n8n@0.140.0

إعجاب واحد (1)

Just convert it once it arrives?

Try this, ignore the IMAP part, but it’s about turning a file into Binary: