Uploaded image for project: 'Sakai'
  1. Sakai
  2. SAK-25455

Folder upload is possible with Drag & Drop in Chrome 21+

    XMLWordPrintable

    Details

      Description

      In SAK-22306, Sakai added Drag & Drop upload of files to Resources with the library dropzone.js (1). This awesome feature has an important lack: folders are not supported. In fact, uploading a folder in Firefox fails, something that was fixed in SAK-25415 avoiding the upload of any object that is not a file.

      In HTML5 specification of Drag & Drop, folder upload was added time ago (2) and Chrome supports it since version 21 (3).

      Dropzone.js library also includes this feature in its latest stable release 3.7.4 (4). It uses interface DataTransferItem and its method getAsEntry(). That is, attribute file.fullPath (5) gives us the path of every uploaded file.

      Sending this parameter in request would be trivial. And in server side, this path could be used to replicate the directory tree, though it would be necessary some hard testing of security.

      So Drag & Drop of a folder's tree could be possible (currently only for Chrome 21+, likely in more browsers in the future).

      In our opinion, having this feature applied could finish definitely with the need of WebDAV.

      I attach a screenshot where I show path of files sent as a header (just because it was easier to test)

      (1) http://www.dropzonejs.com/
      (2) http://wiki.whatwg.org/wiki/DragAndDropEntries
      (3) http://updates.html5rocks.com/2012/07/Drag-and-drop-a-folder-onto-Chrome-now-available
      (4) https://github.com/enyo/dropzone/blob/v3.7.4/downloads/dropzone.js
      (5) http://dev.w3.org/2009/dap/file-system/file-dir-sys.html#the-entry-interface

        Gliffy Diagrams

          Zeplin

            Attachments

              Issue Links

                Activity

                  People

                  Assignee:
                  jbush John Bush
                  Reporter:
                  daniel.merino Daniel Merino Echeverría
                  Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                    Dates

                    Created:
                    Updated:
                    Resolved:

                      Git Integration