# Get file path from upload component

**URL:** <https://community.plotly.com/t/get-file-path-from-upload-component/9934>\
**Category:** Dash Python\
**Created:** [April 26, 2018, 1:48pm UTC](https://community.plotly.com/t/get-file-path-from-upload-component/9934 "2018-04-26T13:48:03Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![chriddyp](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/chriddyp/32/16855_2.png) [@chriddyp](https://community.plotly.com/u/chriddyp)\
**Post date:** [April 29, 2018, 6:43pm UTC](https://community.plotly.com/t/get-file-path-from-upload-component/9934/4 "2018-04-29T18:43:56Z")

</div>

In many cases, you don’t actually need the `filename` - The contents of the file are contained through the `contents` property of the `dcc.Upload` component. And note that if your app is deployed on a server, you won’t be able to read a file given by the “filename” as that file won’t exist on the server.  
If you need to refer to a saved file, then you can just save the `contents` property to the disk and make up the filename yourself.

If your app is reading files on a _local_ machine, i.e. if you aren’t deploying your app to a server, then an alternative to using the `dcc.Upload` component would be to display a list of files in a `dcc.Dropdown` component and allow the user to select a filename.

---

_[View the full topic](https://community.plotly.com/t/get-file-path-from-upload-component/9934)._
