Skip to content
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

Add folder upload #981

Merged
merged 4 commits into from
Jun 16, 2020
Merged

Add folder upload #981

merged 4 commits into from
Jun 16, 2020

Conversation

ramiresviana
Copy link
Contributor

Description
Implements ability to upload folders via drag and drop.

Further comments
Uses DataTransferItem.webkitGetAsEntry() to recursively retrieve data from directories, allows multiple selection with files and directories. Works with modern browsers, fallback to old DataTransfer API when not compatible.

@o1egl
Copy link
Member

o1egl commented Jun 11, 2020

@ramiresviana thank you for your PR. Could you please fix build errors?

@ramiresviana
Copy link
Contributor Author

@o1egl fixed build errors.

@o1egl
Copy link
Member

o1egl commented Jun 15, 2020

@ramiresviana great job. Can you please add support of upload button too?

@ramiresviana
Copy link
Contributor Author

@o1egl is not possible to make an input that accepts both files and folders. What can be made is add another button in the header that only allows selecting folders for upload.

@o1egl
Copy link
Member

o1egl commented Jun 15, 2020

@ramiresviana do you have an idea how to display it? Maybe we can display a popup with 2 file/filder options if browser supports it.

@ramiresviana
Copy link
Contributor Author

@o1egl i can make an prompt that opens when the user clicks on upload button, like this:
image

@o1egl
Copy link
Member

o1egl commented Jun 15, 2020

@ramiresviana that would be perfect! But let’s add browser compatibility check and display it only for supported ones.

@ramiresviana
Copy link
Contributor Author

  • Added upload prompt: shows when header upload button is clicked. When browser does not support webkitGetAsEntry for folder upload, file picker window will be showed without prompt.
  • Empty folder upload: allows uploading empty folder structure. Works only with drag and drop, because form file input does not return empty folders.

@o1egl the buttons in the upload prompt are responsive and can be reused in other components if needed.

@o1egl
Copy link
Member

o1egl commented Jun 16, 2020

@ramiresviana awesome job!

@o1egl o1egl merged commit 8977344 into filebrowser:master Jun 16, 2020
monkeyWie pushed a commit to monkeyWie/filebrowser that referenced this pull request Jun 22, 2020
* feat: folder upload
fix filebrowser#741

* fix: apply gofmt formater

* feat: upload button prompt

* feat: empty folder upload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants