Uppy: Add ability to upload folders & recreate user file system

Created on 7 Dec 2017  路  4Comments  路  Source: transloadit/uppy

I looked around but didn't find anything about this feature, strangely.
I believe it could be useful to upload whole folders (and subfolders) with Uppy. It should be just a matter of adding the right attributes to an input field: <input type="file" multiple directory webkitdirectory allowdirs/>. All browsers except Safari support this. The problem could be the UI/UX of this feature.

The other interesting part could be then to pass the files to the backend with all the infos that makes possible, if desired, to recreate the directory tree of the user. Chrome and Firefox exposes the webkitRelativePath parameter in the File object to accomplish this.
image

Feature Improvement

Most helpful comment

Your right @arturi, you can't upload directories and/or files, it鈥檚 one or the other. Indeed in our app we provide one main input for file uploads and a secondary, less prominent, input for folder uploads.
To me, and also to our users, the ability to easily recreate entire local directory trees in our cloud environment has shown to be a highly appreciated feature. But I understand that the point of view are different.
Maybe a new source in the top bar of Uppy Dashboard is the right location for a specific folder upload button?

All 4 comments

Regarding the first part, whole folders are supported via drag and drop, with some issues, but with file input seems like support is experimental: https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/webkitdirectory. Should we add it still?

pass the files to the backend with all the infos that makes possible, if desired, to recreate the directory tree of the user

That could be done by simply passing webkitRelativePath as a meta property like originalPath or something?

whole folders are supported via drag and drop

Ahh right, not very intuitive for the user though. With file input the support seems pretty good to me nowadays, all major browsers (except Safari) support the feature one way or another (we're using it in production for several months). I recently discovered this library (funny coincidence) dedicated specifically to that (not that it's needed): https://github.com/silverwind/uppie

That could be done by simply passing webkitRelativePath as a meta property like originalPath or something?

Yeah seems like a good and simple idea to me.

I checked this again, and from my tests it seems there鈥檚 no way to allow adding directories and/or files, it鈥檚 one or the other. So we鈥檇 have to provide two inputs, one for folders, one for files.

I think it鈥檚 an overkill, so will close this for now, unless I鈥檓 overlooking something, please let me know.

webkitRelativePath only works when folder was selected, so these two need to be added together.

Your right @arturi, you can't upload directories and/or files, it鈥檚 one or the other. Indeed in our app we provide one main input for file uploads and a secondary, less prominent, input for folder uploads.
To me, and also to our users, the ability to easily recreate entire local directory trees in our cloud environment has shown to be a highly appreciated feature. But I understand that the point of view are different.
Maybe a new source in the top bar of Uppy Dashboard is the right location for a specific folder upload button?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

NihadOb picture NihadOb  路  3Comments

agreene-coursera picture agreene-coursera  路  4Comments

yaegor picture yaegor  路  3Comments

risonsimon picture risonsimon  路  4Comments

quetzyg picture quetzyg  路  3Comments