ipywidgets
ipywidgets copied to clipboard
fileUpload - possibility of obtaining the file path in the FileUpload.value metadata
Hi There It would be great if I could obtain the file path from the fileUpload Widget. Maybe in the metadata section which currently contains the name but not the path.
{'law_data.csv': {'metadata': {'name': 'law_data.csv', 'type': 'text/csv', 'size': 981371, 'lastModified': 1563733119625},
I love ipywidgets... thank you!!
I think we don't have access to the path, just the filename: https://developer.mozilla.org/en-US/docs/Web/API/File
However, https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#Value indicates that the input might have the path to the first file? Or the browser may just put the filename in there without the path. If you want to investigate if the browser file input exposes the path, that would be the first step, I think.
Thanks a lot for the fast reply, I will investigate.
I just found ipyfilechooser (in pypi) extremely useful to that use-case. I believe this is also what you were looking for, @aideenf