Open bpl-coding opened 2 years ago
Oh yeah, there has been a lot of changes in the 0.7.0 development branch which will unfortunately also have backwards-incompatible changes. I will have to document the things well when the release happens. I assume that you have built the JS yourself, which also might not been easy. As more people are trying the 0.7.0 I might as well go and make a pre-release available in PyPI so people can try it out without the NodeJS hassle.
Anyway, most probably the problem is with your callback structure. In the dev
repo, the usage.py
has a callback like this:
import dash_html_components as html
import dash_uploader as du
@du.callback(
output=Output("callback-output", "children"),
id="dash-uploader",
)
def callback_on_completion(status: du.UploadStatus):
if status.n_uploaded == 0:
return # no files uploaded yet.
print(status)
out = []
if status.uploaded_files is not None:
return html.Ul([html.Li(str(x)) for x in status.uploaded_files])
return html.Div("No Files Uploaded Yet!")
I should update the docs for the changes needed for the callbacks. The du.UploadStatus
object is best described in Issue 68.
I uploaded a pre-release version (0.7.0a1) to PyPi. You can install it with:
python -m pip install dash-uploader --pre
I am trying to use the 0.7.0 dev branch for its multi-file uploading enhancements.
The files are successfully uploaded, however, it does not appear that any filenames are being passed via callback. This is true even when only 1 file is uploaded.
I have switched to using the "uploadedFileNames" prop as it seems "isCompleted" and "filenames" are deprecated.
Am I doing something wrong?
[2022-03-29 20:56:33,279] DEBUG in httprequesthandler: File saved to: du_files\d8e79e88-3f60-4ae1-8312-e5f99dba5f11\Server_Results_20201221.log [] [2022-03-29 20:56:33,648] DEBUG in httprequesthandler: File saved to: du_files\d8e79e88-3f60-4ae1-8312-e5f99dba5f11\Server_Results_20201107.log [2022-03-29 20:56:34,011] DEBUG in httprequesthandler: File saved to: du_files\d8e79e88-3f60-4ae1-8312-e5f99dba5f11\Server_Results_20201208.log [2022-03-29 21:02:22,034] DEBUG in httprequesthandler: File saved to: du_files\5eabaf90-b53a-4782-9925-855bcde438e2\Server_Results_20201221.log [] [2022-03-29 21:02:22,750] DEBUG in httprequesthandler: File saved to: du_files\5eabaf90-b53a-4782-9925-855bcde438e2\Server_Results_20201208.log []