KendoUpload directoryDrop both folders and files

4 posts, 0 answers
  1. James
    James avatar
    2 posts
    Member since:
    Dec 2015

    Posted 08 Jun Link to this post

    Is there a solution to that allows users to drag and drop both a file and folder at the same time?

    If not, is there a workaround to drop files and folders independently into the same drop zone. Currently, have a half-backed solution that changes the options.directoryDrop on the drop event, but only works on the second drop attempt. The timing of setting the option seems to be too late.

     

     $("#files").kendoUpload({
                        async: {
                            saveUrl: "/document/upload",
                            autoUpload: true
                        },
                        directoryDrop: true,
                        dropZone: ".dropZone"
                    });

     

                    $(".dropZone").on("drop", function (e) {
                        e.preventDefault();
                        e.stopPropagation();
                        var isFolder = false;
                        var files = e.originalEvent.dataTransfer.files;

                        // find at least one folder in dropped files

                        $.each(files, function (i,file) {

                            // folders are identified with no extension and segment size of 4096
                            if (!file.type && file.size % 4096 === 0)  isFolder = true;
                        });

                        $("#files").data("kendoUpload").options.directoryDrop = isFolder;
                    });

     

  2. Plamen
    Admin
    Plamen avatar
    2812 posts

    Posted 12 Jun Link to this post

    Hello,

    Currently this is not supported with the default properties and methods yet you can refer to this dojo page where is shown one way to override the _Drop of the widget method and achieve similar behavior. 

    Regards,
    Plamen
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. James
    James avatar
    2 posts
    Member since:
    Dec 2015

    Posted 12 Jun in reply to Plamen Link to this post

    Appreciate the dojo to identify dropped items as a folder or file.

    Processing both files and folders from Kendo Upload is not supported but still exploring for any workarounds.

     

  4. Plamen
    Admin
    Plamen avatar
    2812 posts

    Posted 13 Jun Link to this post

    Hi,

    I have tried to upload file and folder at the same time in the dojo that I sent you in my previous reply and it worked correctly. Would you please elaborate what exactly is the scenario that you are still exploring so we could inspect it and be more helpful?

    Regards,
    Plamen
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top