# Need help on reading files on server from a custom plugin

**URL:** <https://discuss.elastic.co/t/need-help-on-reading-files-on-server-from-a-custom-plugin/196095>\
**Category:** Kibana\
**Created:** [August 21, 2019, 11:41am UTC](https://discuss.elastic.co/t/need-help-on-reading-files-on-server-from-a-custom-plugin/196095 "2019-08-21T11:41:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![PedroJG](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pedrojg/32/52701_2.png) [@PedroJG](https://discuss.elastic.co/u/PedroJG)\
**Post date:** [August 21, 2019, 11:41am UTC](https://discuss.elastic.co/t/need-help-on-reading-files-on-server-from-a-custom-plugin/196095/1 "2019-08-21T11:41:25Z")

</div>

I'm developing a plugin which will read a fixed csv file from the server.

The problem is I'm not able to comprehend how Kibana exposes the files that I can read or can't.  
I'm running both Elasticsearch and Kibana with yarn, in my folder kibana/plugins/editor.

Where should I place my csv file so that I could read it with a XMLHttpRequest().open("GET", , true)?

---

<div class="post-metadata">

**Author:** ![tsullivan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsullivan/32/31077_2.png) [@tsullivan](https://discuss.elastic.co/u/tsullivan)\
**Post date:** [August 21, 2019, 10:04pm UTC](https://discuss.elastic.co/t/need-help-on-reading-files-on-server-from-a-custom-plugin/196095/2 "2019-08-21T22:04:54Z")

</div>

> [@PedroJG](#):
>
> Where should I place my csv file so that I could read it with a XMLHttpRequest().open("GET", , true)?

If you want the CSV data exposed to browser code when you make an AJAX call, your plugin will need to create a new server route that is responsible for responding to queries and in response, sends back the CSV data to the client.

The browser code would make the AJAX call to your new server route.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [September 18, 2019, 10:04pm UTC](https://discuss.elastic.co/t/need-help-on-reading-files-on-server-from-a-custom-plugin/196095/3 "2019-09-18T22:04:57Z")

</div>

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