# Upload a file and use it as global variable

**URL:** <https://community.plotly.com/t/upload-a-file-and-use-it-as-global-variable/11374>\
**Category:** Dash Python\
**Created:** [June 30, 2018, 11:35am UTC](https://community.plotly.com/t/upload-a-file-and-use-it-as-global-variable/11374 "2018-06-30T11:35:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![alex1](https://avatars.discourse-cdn.com/v4/letter/a/898d66/32.png) [@alex1](https://community.plotly.com/u/alex1)\
**Post date:** [June 30, 2018, 11:35am UTC](https://community.plotly.com/t/upload-a-file-and-use-it-as-global-variable/11374/1 "2018-06-30T11:35:50Z")

</div>

Hi,

I’m relatively new to Dash, I’ve covered tutorials available online, and I’m trying to create a simple ML app in dash that would allow user to process a file that he uploads and display the results. For calculations, it would be great to make uploaded file available globally as pandas df, so I can call it in functions etc… Does anyone knows how to perform this?

---

<div class="post-metadata">

**Author:** ![anu](https://avatars.discourse-cdn.com/v4/letter/a/aca169/32.png) [@anu](https://community.plotly.com/u/anu)\
**Post date:** [June 30, 2018, 12:20pm UTC](https://community.plotly.com/t/upload-a-file-and-use-it-as-global-variable/11374/2 "2018-06-30T12:20:33Z")

</div>

You can use `dcc.upload` for that. Are you making a multi-page app?

---

<div class="post-metadata">

**Author:** ![alex1](https://avatars.discourse-cdn.com/v4/letter/a/898d66/32.png) [@alex1](https://community.plotly.com/u/alex1)\
**Post date:** [July 7, 2018, 6:11pm UTC](https://community.plotly.com/t/upload-a-file-and-use-it-as-global-variable/11374/3 "2018-07-07T18:11:00Z")

</div>

Hi,

Sorry for replying this late. Currently I’m trying to do it all in one page, maybe I’ll split it in future, so on one page to be upload and then to redirect to page where results will be displayed. Maybe I’m missing something with dcc.upload, but all I’ve seen from documentation is that it’s using callbacks to display data and manipulate html components, but my idea is to upload it as global variable and do calculations outside and pass newly created tables into callbacks and display and graph them?
