-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Allow to upload directories and allow bulk upload #1175
Conversation
0a5ba1e
to
ef945ce
Compare
ef945ce
to
1ef79f3
Compare
1ef79f3
to
5b86d5d
Compare
5b86d5d
to
47c0ea4
Compare
|
||
try { | ||
const content = path === '' ? this.currentContent : await this.getContent(path).catch(() => []) | ||
const conflicts = getConflicts(nodes, content) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does getCOnflicts
also check conflicts on folders and does it recursively? Or maybe the nodes list is flat?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually what happens when the user upload a folder with a name that is already taken by another folder?
Is the new folder name updated? Or is the new folder merged into the existing one?
If the last option is used, it means that we have to recursively get the folder content to check for conflicts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The conflicts are resolved recursively like your file manager does on your OS.
getConflicts
only gets conflicts in the current level, then it lets you decide what todo:
- Select the new one (aka "write into")
- Select the old one (aka skip the upload)
- Select both: Rename the new one
2f43c3d
to
321331b
Compare
Testing is possible with this server PR: nextcloud/server#45095 Just checkout the server link the upload package and build :) |
321331b
to
c330da5
Compare
This is required for uploading folders, as `<input type="file" webkitdirectory />` will provide a flat array of files with just the relative path provided. So we can build the virtual file tree and upload layer by layer. Signed-off-by: Ferdinand Thiessen <[email protected]>
Signed-off-by: Ferdinand Thiessen <[email protected]>
Signed-off-by: Ferdinand Thiessen <[email protected]>
Signed-off-by: Ferdinand Thiessen <[email protected]>
c330da5
to
538c31e
Compare
Added a
Directory
class that allows creating a virtual filesystem.Meaning the directory contains a tree of child nodes.
Then this tree is uploaded level by level within the uploader (new method
bulkUpload
).The UploadPicker now also support directories when created with
allow-folders
.