Black Lives Matter. Please consider donating to Black Girls Code today.

Dash Upload - Uploading a Text File

how to upload a text file using upload?

Try running the example in the docs here: https://dash.plot.ly/dash-core-components/upload. The contents property of the dcc.Upload component will provide you with a base64 encoded version of the file, so

    decoded = base64.b64decode(content_string)

decoded will likely be what you are looking for in that example.

1 Like

Thank you so much for quick reply. Decoded content string was in byte string format .I used cp1252 decoding and then I got text in regular string format.Problem solved…!!

1 Like