Thanks chriddyp for your reply. I tried with my implementation first, which was giving me similar html doc, then I tried with the above example and it gave me the same html doc.
With my implementation I was not able to see the table also on the web page, but with yours I was able to see the table on the webpage but the download link was giving me html doc. I just figured out that this is because of urllib package. I was running this with python 3. I think python version might be the culprit here. Check your python version. You will have to import urllib.
I was having some issues downloading files over 10k rows, and I figured that with Firefox the link works better, has anyone experienced something like that? This can support csv file up to KB. Download data from plot. Downloading raw data with customized name. I do not want to host downloadable files on server One option is to host the files remotely but download them on-the-fly in a callback or on app start.
Output 'download-chosen', 'href' , [dash. The way I do it from here is to merge all my filters on the dataframe in the link like this:. Then I get the value and decompose it in its single parts which I then use to subset my dataframe:. The example I gave above gives all arguments to the Flask route it needs to recreate a data frame.
The idea is to within the route be able to re-filter the data matching the dashboard. Here you see how you could use a callback to create a file on disk, and a Flask route serving out the file. This proved to be a better solution for me in some use cases. Some adaptations I did in addition to the example:.
And on the hidden div use case: seems there is now a dedicated component for that use case called dcc. Download data from plot. Download data from dcc. Store as csv? How to download a pdf file generated from a plot? Use Html Link component from dash-html-components to provide link for the csv file. Anyone have success with this? Including static files. Download raw data. Allow users to dowload an Excel in a click. Get Dataframe as a csv file. Downloading file issues. For example: app.
StringIO strIO. Exporting data filtered based on user interaction in the GUI. Where do I have to put files for download? Would it be possible to post a short example of a complete app? Would it be something like… app.
It would be app. BytesIO mem. Clean way to download table data. Using an endpoint to initialize Dash app. I returned the href since the download attribute did not work for me.
The big mistake that I made was that my index. Location url used to be:. By removing the apps from the url the problem was promptly solves. Stack Overflow for Teams — Collaborate and share knowledge with a private group.
Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. How to download a file with plotly-dash on a multi-page app? Ask Question. Asked 1 year, 7 months ago. Active 7 months ago. Viewed 2k times. Div [ dcc. What is the best way to still make files downloadable? Lukas Lukas 1 1 silver badge 11 11 bronze badges.
Add a comment. Active Oldest Votes. Ok, I have solved it now. In the documentation it says: The dcc. As stated here , download Prompts the user to save the linked URL instead of navigating to it.
0コメント