# Send Csv file to telegram bot

**URL:** https://discourse.nodered.org/t/send-csv-file-to-telegram-bot/38276
**Category:** General
**Created:** [30 December 2020 11:30 UTC](https://discourse.nodered.org/t/send-csv-file-to-telegram-bot/38276 "2020-12-30T11:30:17Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![Maruthi](https://avatars.discourse-cdn.com/v4/letter/m/f08c70/32.png) [@Maruthi](https://discourse.nodered.org/u/Maruthi)
#### Post date: [30 December 2020 11:30 UTC](https://discourse.nodered.org/t/send-csv-file-to-telegram-bot/38276/1 "2020-12-30T11:30:17Z")

</div>

Hi

I'm saving the sensor data to csv file and I want to send the saved csv file to telegram bot

I'm getting unsupported buffer file type when i send it as document type

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [30 December 2020 11:31 UTC](https://discourse.nodered.org/t/send-csv-file-to-telegram-bot/38276/2 "2020-12-30T11:31:23Z")

</div>

So what is you problem and what have you tried?

---

<div class="post-metadata">

### Author: ![Maruthi](https://avatars.discourse-cdn.com/v4/letter/m/f08c70/32.png) [@Maruthi](https://discourse.nodered.org/u/Maruthi)
#### Post date: [30 December 2020 11:40 UTC](https://discourse.nodered.org/t/send-csv-file-to-telegram-bot/38276/3 "2020-12-30T11:40:28Z")

</div>

![f](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/4/f4edb21593f1375d8209bcdf65d61beb9f240993.jpeg)

 ![g](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/8/b8dc496b82850d93b1ecbbedfa9323e6c5ebf397.jpeg)

Tried to upload as .xls and .csv but getting error

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [30 December 2020 11:48 UTC](https://discourse.nodered.org/t/send-csv-file-to-telegram-bot/38276/4 "2020-12-30T11:48:57Z")

</div>

Put a `debug` node (set to display the Complete msg object) on the output of your function node to see what you are sending

---

<div class="post-metadata">

### Author: ![Maruthi](https://avatars.discourse-cdn.com/v4/letter/m/f08c70/32.png) [@Maruthi](https://discourse.nodered.org/u/Maruthi)
#### Post date: [30 December 2020 11:52 UTC](https://discourse.nodered.org/t/send-csv-file-to-telegram-bot/38276/5 "2020-12-30T11:52:34Z")

</div>

![2](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/c/8c6019eb328d468f7d409108166220423339f4f6.jpeg)

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [30 December 2020 12:24 UTC](https://discourse.nodered.org/t/send-csv-file-to-telegram-bot/38276/6 "2020-12-30T12:24:43Z")

</div>

So that is not a document it is a buffer which is why you get the error. Try exporting your spreadsheet as a csv file and sending that

---

<div class="post-metadata">

### Author: ![Maruthi](https://avatars.discourse-cdn.com/v4/letter/m/f08c70/32.png) [@Maruthi](https://discourse.nodered.org/u/Maruthi)
#### Post date: [30 December 2020 12:49 UTC](https://discourse.nodered.org/t/send-csv-file-to-telegram-bot/38276/7 "2020-12-30T12:49:08Z")

</div>

![3](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/c/ac56b96e53cfb41b47a43009c4f96b9db93d0472.jpeg)

I'm able to select from this list,

Sorry, I'm new to this

How to do it, any reference can I get

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [30 December 2020 13:34 UTC](https://discourse.nodered.org/t/send-csv-file-to-telegram-bot/38276/8 "2020-12-30T13:34:36Z")

</div>

have you tried the other options?

---

<div class="post-metadata">

### Author: ![Maruthi](https://avatars.discourse-cdn.com/v4/letter/m/f08c70/32.png) [@Maruthi](https://discourse.nodered.org/u/Maruthi)
#### Post date: [30 December 2020 14:00 UTC](https://discourse.nodered.org/t/send-csv-file-to-telegram-bot/38276/9 "2020-12-30T14:00:00Z")

</div>

yeah tried all four, didn't succeed

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [30 December 2020 14:04 UTC](https://discourse.nodered.org/t/send-csv-file-to-telegram-bot/38276/10 "2020-12-30T14:04:24Z")

</div>

Is the incoming file is CSV format?? The `CSV` node

> # csv
> 
> Converts between a CSV formatted string and its JavaScript object representation, in either direction.

So if you are reading in a excel file it won't work. The file coming in has to be is CSV format (which is why I told you:

> Try exporting your spreadsheet as a csv file and sending that

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [30 December 2020 14:19 UTC](https://discourse.nodered.org/t/send-csv-file-to-telegram-bot/38276/11 "2020-12-30T14:19:16Z")

</div>

Once you've fixed the buffer issue, what makes you think that Telegram understands CSV format? What are you wanting to achieve?

If you want to upload it as a file that can be downloaded by a Telegram user, you need to format the payload correctly: [Uploading and Downloading Files (telegram.org)](https://core.telegram.org/api/files)

---

<div class="post-metadata">

### Author: ![Maruthi](https://avatars.discourse-cdn.com/v4/letter/m/f08c70/32.png) [@Maruthi](https://discourse.nodered.org/u/Maruthi)
#### Post date: [8 February 2021 09:28 UTC](https://discourse.nodered.org/t/send-csv-file-to-telegram-bot/38276/12 "2021-02-08T09:28:16Z")

</div>

Thanks for the information,

I just needed the log file which can send me regularly

so, now I'm sticking to email

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [9 April 2021 09:28 UTC](https://discourse.nodered.org/t/send-csv-file-to-telegram-bot/38276/13 "2021-04-09T09:28:49Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
