plotly / plotly/dash

enable download of large file via dcc.download

Open
#1,874 4 comments 9 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug cs P2
Dominant language
Python
Stars
24.4k
Forks
2.3k
Avg merge
2d 7h
Merged PRs (30d)
13

Description

My code is attached below, very simple. I test the download function successfully with a small sample (1MB). However, I need to return a large file(CSV) of about 1 GB, which raises the Memory Error. What should I do?

dbc.Button('Download', color='primary', id='btn_data',outline=True),
                                dcc.Download(id="download-image")
@app.callback(
    Output("download_data", "data"),
    Input("btn_data", "n_clicks"),
    prevent_initial_call=True,
)
def func(n_clicks):
    return dcc.send_file(
        "./download/verylarge.csv"
    )

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the callback using dcc.Download and dcc.send_file, then reproduce the reported Memory Error with the approximately 1 GB CSV rather than the 1 MB sample. Done means a large CSV can be downloaded without exhausting memory; the issue does not name a source file or test to update.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.