dcc.Upload upload entire folder

Is there a way to upload an entire folder with all its contents as well as the folder structure?

It looks like this is supported by Dropzone (which I think is the underlying library for this component?).

If not, is it possible to use dash_core_components.Input for this? HTML5 supports folder uploads by adding directory or webkitdirectory attributes:

<input type="file" id="folder-input" webkitdirectory="" directory="">

3 Likes

hey, did you find a solution to this? looking into it now myself… :sleeping:

1 Like

I am also interested if someone finds the solution. In the meantime, my workaround has been to accept .zip files which may have a large directory structure inside of them. In the callback, I just extract the .zip file to the disk. Of course this is a bit suboptimal since the user has to go through the hassle of zipping the files he/she wants to upload.

I am also interested to know if there has been a solution to this.

For my current case, I need to upload a directory name using a feature similar to dcc.Upload (drag & drop or select).

The directory then contains an expected structure of a few sub-directories, and then sets of .csv and text files which need to be read/uploaded for processing.

The app does not need access to full file path - only a directory name.

Apparently dcc.Upload will not a return a file directory name using the drag&drop feature of dcc.Upload.

Any suggestions appreciated.