# How to send an attachment in response from Rasa core action

**URL:** <https://forum.rasa.com/t/how-to-send-an-attachment-in-response-from-rasa-core-action/4248>\
**Category:** Rasa Open Source\
**Created:** [January 11, 2019, 9:21am UTC](https://forum.rasa.com/t/how-to-send-an-attachment-in-response-from-rasa-core-action/4248 "2019-01-11T09:21:20Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Akashvijay22](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/akashvijay22/32/1738_2.png) [@Akashvijay22](https://forum.rasa.com/u/Akashvijay22)\
**Post date:** [January 11, 2019, 9:21am UTC](https://forum.rasa.com/t/how-to-send-an-attachment-in-response-from-rasa-core-action/4248/1 "2019-01-11T09:21:20Z")

</div>

How to send an attachment in response from Rasa core action. For example , User ask for a particular document/template which can be a doc, excel or pdf. how can i return it in response so that it can download at user end.

---

<div class="post-metadata">

**Author:** ![ricwo](https://avatars.discourse-cdn.com/v4/letter/r/7ea924/32.png) [@ricwo](https://forum.rasa.com/u/ricwo)\
**Post date:** [January 22, 2019, 5:21pm UTC](https://forum.rasa.com/t/how-to-send-an-attachment-in-response-from-rasa-core-action/4248/2 "2019-01-22T17:21:05Z")

</div>

Hi @Akashvijay22, you cannot directly download files through an action. you could however write a custom action that locates the file, uploads it to a server and returns the download link as an utterance

---

<div class="post-metadata">

**Author:** ![Asya](https://avatars.discourse-cdn.com/v4/letter/a/22d042/32.png) [@Asya](https://forum.rasa.com/u/Asya)\
**Post date:** [January 30, 2019, 11:44am UTC](https://forum.rasa.com/t/how-to-send-an-attachment-in-response-from-rasa-core-action/4248/3 "2019-01-30T11:44:22Z")

</div>

@ricwo can you share the code snippet for the same?

---

<div class="post-metadata">

**Author:** ![Akashvijay22](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/akashvijay22/32/1738_2.png) [@Akashvijay22](https://forum.rasa.com/u/Akashvijay22)\
**Post date:** [February 2, 2019, 5:49am UTC](https://forum.rasa.com/t/how-to-send-an-attachment-in-response-from-rasa-core-action/4248/4 "2019-02-02T05:49:40Z")

</div>

Hi Asya, If your data is not huge then pass data in json to client( front end ) side and use js libs for download . I did the same for excel file.

---

<div class="post-metadata">

**Author:** ![Asya](https://avatars.discourse-cdn.com/v4/letter/a/22d042/32.png) [@Asya](https://forum.rasa.com/u/Asya)\
**Post date:** [February 2, 2019, 5:58am UTC](https://forum.rasa.com/t/how-to-send-an-attachment-in-response-from-rasa-core-action/4248/5 "2019-02-02T05:58:57Z")

</div>

> [@ricwo](#):
>
> write a custom action that locates the file, uploads it to a server and returns the download link as an utterance

i am really new to the whle thing… so…could you share this code for the custom action mentioned here?

---

<div class="post-metadata">

**Author:** ![ricwo](https://avatars.discourse-cdn.com/v4/letter/r/7ea924/32.png) [@ricwo](https://forum.rasa.com/u/ricwo)\
**Post date:** [February 2, 2019, 9:59am UTC](https://forum.rasa.com/t/how-to-send-an-attachment-in-response-from-rasa-core-action/4248/6 "2019-02-02T09:59:42Z")

</div>

Hi Asya, you could just store all your files in, say, Google Drive and keep an index of download links in your custom action. Your action needs to implement logic to find the right file, and you can just utter the download link back to the user, either in plain text or as a HTML if your chat interface support it:

```auto
<a href="link to your Google drive file" target="_blank">download here</a>

```

To do this, use the `dispatcher.utter_message` method.

---

<div class="post-metadata">

**Author:** ![Asya](https://avatars.discourse-cdn.com/v4/letter/a/22d042/32.png) [@Asya](https://forum.rasa.com/u/Asya)\
**Post date:** [February 2, 2019, 10:37am UTC](https://forum.rasa.com/t/how-to-send-an-attachment-in-response-from-rasa-core-action/4248/7 "2019-02-02T10:37:45Z")

</div>

Thanks mate!

---

<div class="post-metadata">

**Author:** ![juansabaye](https://avatars.discourse-cdn.com/v4/letter/j/439d5e/32.png) [@juansabaye](https://forum.rasa.com/u/juansabaye)\
**Post date:** [May 8, 2020, 3:26pm UTC](https://forum.rasa.com/t/how-to-send-an-attachment-in-response-from-rasa-core-action/4248/8 "2020-05-08T15:26:19Z")

</div>

Just to be clear. The chatbot can not show a pdf,excel,word,etc file in the chat, even if the chat environment doesn’t recognize it?
