Attempting to upload a folder fails with unclear error

Bug #1605072 reported by Dmitrii Metelkin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Medium
Dmitrii Metelkin

Bug Description

- exact version of Mahara - master
- operating system - Linux, OSX
- database - Postgres
- browser and version - Safari (v. 9.1.1) and Firefox (v.47.0.1)

Test scenario:

1. Login to ePortfolio, go to Content > Files
2. Drag a folder from your file manager to the ‘Drop files her to upload’ region

Expected: all files in the folder uploaded
Actual result: Error “Server responded with 0 code.[object XMLHttpRequest]”

Revision history for this message
Dmitrii Metelkin (dmitriim) wrote :
Revision history for this message
Dmitrii Metelkin (dmitriim) wrote :

Looks like this JS library is not actively supported. The last commit to the master was more than two years ago. Maybe we should think of changing this library to something well supported?

Revision history for this message
Kristina Hoeppner (kris-hoeppner) wrote :

Mahara never explicitly supported the upload of an entire folder, but only of multiple files at once or a zip file. Hence, why I marked it as wishlist item. If it is only to update the error message, then a separate bug should be filed. As for moving to a different dropzone library, that is also a wishlist item.

Changed in mahara:
importance: Undecided → Wishlist
status: New → Confirmed
Revision history for this message
Dmitrii Metelkin (dmitriim) wrote :

Totally agree. The only way to implement this as far as I can see is patching js library to return correct error message.

Revision history for this message
Aaron Wells (u-aaronw) wrote :

To expand on this little, it looks like drag-and-drop of a folder is not currently supported by all browsers. Chrome implemented it two years ago (see http://stackoverflow.com/questions/3590058/does-html5-allow-drag-drop-upload-of-folders-or-a-folder-tree ), but it's not yet in the standard. In other browsers, the browser tries to read the folder file itself (as a zero-byte file), rather than reading the folder's contents.

I tested it out in Gmail on Firefox just now, and indeed got an error message about having uploaded a zero-byte file. So I think that further confirms that cross-browser folder upload support isn't yet available.

So with that being the case, Dmitrii's idea of making a more polite error message, is a good improvement for the time being.

Revision history for this message
Aaron Wells (u-aaronw) wrote :

Regarding DropZone.js, the latest commit to master was April 14, 2016 (merging a pull request), not two years ago. There hasn't been a lot of activity on it in the last two years, but it looks like the project maintainer is still checking in on it from time to time at least.

We probably should upgrade from our current 4.2.0 to the latest release 4.3.0, which came out in Feb 2016.

Revision history for this message
Dmitrii Metelkin (dmitriim) wrote :

Oh. Looks like i was looking at the wrong branch.
I'm going to work on this bug. Do you think's a good idea to update the library first and then patch it to implement more polite error message?

Changed in mahara:
assignee: nobody → Dmitrii Metelkin (dmitriim)
Revision history for this message
Dmitrii Metelkin (dmitriim) wrote :

This should be implemented after https://bugs.launchpad.net/mahara/+bug/1606086

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/6749

Changed in mahara:
status: Confirmed → In Progress
Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/6749
Committed: https://git.mahara.org/mahara/mahara/commit/34f4ceeb8d4b515e29ab7ef68b32b6fc2af98ea2
Submitter: Aaron Wells (<email address hidden>)
Branch: master

commit 34f4ceeb8d4b515e29ab7ef68b32b6fc2af98ea2
Author: Dmitrii Metelkin <email address hidden>
Date: Mon Jul 25 11:54:28 2016 +1000

Bug 1605072: add a friendly error message when dropzone fails upload a folder

behatnotneeded

Change-Id: Icaafe3e7f3ee77aaece9f891fda1db40d5a235fe

summary: - Attempting to upload a folder fails with the error
+ Attempting to upload a folder fails with unclear error
Changed in mahara:
milestone: none → 16.10.0
importance: Wishlist → Medium
status: In Progress → Fix Committed
Robert Lyon (robertl-9)
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.