dash
dash copied to clipboard
dcc.Upload errors with big files
Context
- Creating an app where end users can upload files >1GB with
dcc.Upload. - The app code is the same as the first sample app of the doc page: https://dash.plotly.com/dash-core-components/upload
max_sizeis set to-1
Issues
- If I run the app with gunicorn or in my local env, some time after I upload the file the tab freezes or I get an internal server error (NOT a timeout because
dcc.Uploadhas some kind of async functionality). > This is similar to what this issue describes: https://github.com/plotly/dash/issues/1728 - If I run the app with Python in a Dash Enterprise workspace, I get a callback error which is kind of weird. If you look at the callback code and the print statements in the terminal, we only get two values despite having three Inputs. The first one is probably an empty string or list, which causes the if statement to “fail” (since list_of_contents is not None), so the error we see is related to code after the if statement. The real problem is that, even if the filenames and dates get passed correctly, the content is empty > This issue has been described before in the forum: (https://community.plotly.com/t/upload-500mb-csv-but-content-is-empty/83297.
Additional context
- I've tried
dash-uploader(link) and it works okay but I’m concerned about (1) privacy (all files are accessible by all users by default, as opposed to session-specific storage) and (2) memory (how does saving many big files affect the app memory/performance) dash-uploaderis not an official component and it’s not maintained, which raises some concerns regarding production environment.
Request
dcc.Uploadbeing able to handle big files (500MB, >1GB, etc).- If the file is not been processed correctly (
list_of_contentsis empty) show a more helpful error.
@celia-lm I suggest you use other upload components with rich features, cooperate with flask or fastapi streaming file upload service to achieve more efficient file upload function:
https://fac.feffery.tech/AntdUpload https://fac.feffery.tech/AntdDraggerUpload
@CNFeffery I see you promoting the feffery-antd-components fairly often.
Are you able to translate those docs to English?
For example, in the comment above you suggest Celia use the AntdUpload, but it's all in a different language, which will make it very hard to understand how to use.
@Coding-with-Adam That would be a huge project to translate so many documents, I suggest to use some browser translate extensions in current stage(such as https://immersivetranslate.com/ or other AI-driven tools), which we often use to translate English to other language.
@Coding-with-Adam The official website of fac has begun developing features related to the internationalization of documentation. Currently, the documentation is being translated one by one. When users visit https://fac.feffery.tech/, the website will automatically recognize the language preference of the user's computer and render the content in Chinese or English accordingly. Users can also switch languages manually from the top right corner. For example: https://fac.feffery.tech/AntdButton. For the implementation principles and contribution guidelines of the internationalization of the fac official website, please refer to: https://github.com/CNFeffery/feffery-antd-docs/issues/166.
Like magic :) Thanks for the update, @CNFeffery . This automated translation is going to help a lot of community members.