This is a migrated thread and some comments may be shown as answers.
Single Control & Drop Zone for File Upload and Directory Upload
3 Answers 29 Views
This is a migrated thread and some comments may be shown as answers.
Rodney Foley
Top achievements
Rank 1
Rodney Foley asked on 25 Jan 2019, 07:40 PM

I was looking at the demos and playing around with the upload control.  It seems that its designed to either be File uploads or Directory uploads, not do both at the same time. It seems we would would have to have two buttons one to allow choosing files and one to allow choosing a directory. The same with drop locations we could have a custom zone that accepts files and we would have to have another custom zone that only accepts a directory.

Below are some scenarios to help explain. I would love to know if all of these scenarios are possible and if so how. If they all of them are not then I would like to know what the reasoning is behind this limitation.

Scenario One

The user click an "upload" button that they can choice either 1 or more files, or 1 or more directories and the control will handle uploading all of them

Scenario Two
The user drags some files to a drop location and it detects they are files and uploads

Scenario Three
The user drags one or more directories to the same drop location as above and it detects they are directories and uploads the files represented within

3 Answers, 1 is accepted

Sort by
0
Accepted
Marin Bratanov
Telerik team
answered on 29 Jan 2019, 09:46 AM
Hi Rodney,

The folder upload is allowed by the browser through the attributes on the <input type="file" /> that is used to allow file selection. This makes the browser handle clicking on it in a completely different manner (assuming it supports the feature - at the moment only Chrome, Firefox and Edge support it). This is not something that can be controller with the application code as it goes into the client OS and that's something browsers don't allow you to touch for security reasons. You can try the override for dropping items from the following post, yet I cannot guarantee it will not cause issues in newer versions: https://www.telerik.com/forums/kendoupload-directorydrop-both-folders-and-files#O51l2xqohEe2a0vb2A6iQA.

To tie this to the listed scenarios:

  • choosing either files, or folders with the same widget - this is not possible because the selection dialog the browser displays depends on the attributes of the input element. If you change those attributes, the selection dialog will change, but the widget cannot know when to change them on its own.
  • detection whether files or folders are dropped - you could post a feature request for this to get implemented in the Feedback portal: https://feedback.telerik.com/kendo-jquery-ui?listMode=Recent&categoryId=894. For the time being you can try the override above.
  • dragging folders - when directory upload is enabled this should work, you can test it in the demo: https://demos.telerik.com/kendo-ui/upload/directoryupload

 


Regards,
Marin Bratanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Rodney Foley
Top achievements
Rank 1
answered on 29 Jan 2019, 03:27 PM
Thanks Marin! We thought pretty much the same about limitations on the button and its nice to have confirmation. Thanks for the links and we were able to work out a solution for drag and drop supporting either time in one drop zone. 
0
Uwe
Top achievements
Rank 1
answered on 26 Mar 2019, 10:26 AM

Could you share the solution you mentioned that you implemented?

I'm looking for a way to accept dropping of files and folders in the same upload control, too.

Asked by
Rodney Foley
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Rodney Foley
Top achievements
Rank 1
Uwe
Top achievements
Rank 1
Share this question
or