If we need to use some kind of library, a jQuery-based library would be preferred.

http://blueimp.github.com/jQuery-File-Upload/ (probably seems like the best solution for now)
http://www.plupload.com/

Comments

crashtest_’s picture

After reviewing this for at least 4 or 5 minutes, we have come to the well studied conclusion that plupload would probably be the better choice, for a couple of reasons, namely licensing (GPL2 vs. MIT), and other platforms adoption (WordPress), and the consideration that Media currently psuedo supports the plupload method.

aaron’s picture

I believe that the licensing issue is a non-issue, considering that I don't believe that it would be good to package the library within the module anyway. After having previously used both of them, I think that not only is jQuery File Upload slicker, but it is also more preferable because it seems to use a simple HTML uploader, rather than Flash or Silverlight.

dave reid’s picture

plupload does gives us more backwards-compatability for other browsers, and has the "Wordpress is using it" factor. Talking with CrashTest_ it would be good if the file_entity module was "enchanced" by a library but it wasn't a dependency. But if we need it as a dependency, that's something we can consider. The goal would be to move the library that we pick into Drupal 8 core and make it available for all to use.

crashtest_’s picture

We did speak with webchick and she set us straight on the licensing non-issue-ness of it all, so you are absolutely right on that one aaron. I am not sure about the last part of your statement, as I see an HTML 4 and HTML 5 runtimes going on pluploader's examples page: http://www.plupload.com/example_all_runtimes.php

I agree that jQuery File Upload is slick, I personally think out of the box that it looks nicer too! I will take a deeper look at jQFU, though I may lean towards the way WP implemented their upload, it's very well done IMO.

dave reid’s picture

Issue tags: +sprint, +Media Initiative
slashrsm’s picture

As Dave mentioned in #3 Plupload gives us more backward compatibility as it supports Flash and Silverlight. But those are not the only runtimes. It also supports HTML5, HTML4 and some others. It will always select the most appropriate, preferring HTML5. So we get backward compatibility and do not trade off HTML5 for that.

You can try this in Media 7.x-1.x, which supports Plupload. If you enable it and hover it, you'll get the name of the current runtime. You will most likely get HTML5, since I doubt you use any of the crappy browsers :).

But I have another concern. We plan to merge file_entity in core for D8, right? That means that we need to pack Plupload library with core? Is this OK?

RobW’s picture

I'm missing how jQuery file upload is less backward compatible than Plupload. The only dependency I see is javascript.

It also seems more modern and pluggable than Plupload. If the functionality is the same, and the file size and output are lighter, I don't see any reason we can't be better than Wordpress :D.

slashrsm’s picture

The main problem with compatibility is obviously with IE. IE will not allow you to select multiple files in it's file browse window. That limits you to upload one file at a time. It also does not support drag&drop at all. This is true for all versions, even IE9.

That's where Plupload (and similar solutions) come into the game. Plupload is aware of this IE limitations and uses Flash to overcome this. When you use flash to upload file, it's internal file browser window is used, which allows you to select multiple files. I believe there is no way to support drag&drop, though.

jQuery file upload is much nicer, more lightweight and cleaner solution than Plupload, and that's why I personally would prefer to use it. Plupload gives you more standardized experience over all browsers, though. I'd say that adding Plupload to D8 core would be too much. We could implement jQuery file upload (or something similar) and keep Plupload in contrib for those who need IE support.

RobW’s picture

Thanks for the explanation. So +1 for jQuery file upload. Multiple file uploads themselves are a progress enhancement. I think the benefits of a lighter, more modern library outweighs the page working slightly differently in some browsers. Plupload will still exist in contrib for people who want it.

tsvenson’s picture

@slasrsm: Thanks for a great overview of both browser limitations and available options, it really explained it all.

If I read you right about plupload, it requires flash to make multiple file upload possible for IE. Does it require flash for all its other features too?

Even so, requiring flash does disqualify it for being part of File Entity and particularly as an option for D8 core. At least in my book.

slashrsm’s picture

If I read you right about plupload, it requires flash to make multiple file upload possible for IE. Does it require flash for all its other features too?

Plupload implements multiple runtimes. It can work with HTML5, Flash, Silverlight, ... It detects browser capabilities and select runtime, that will work well. Priority of runtimes can be configured AFAIK.

There is a list of multiupload solutions on g.d.o. I posted it few month ago, so it could be a bit out of date.

darvit’s picture

Just an FYI,

Plupload 2 has gone into beta:
http://www.plupload.com/punbb/viewtopic.php?id=2528

Hoping drag/drop and mutiple uploads makes it into Drupal 8....(In 2013/2014 these features will become quite common)

devin carlson’s picture

Status: Active » Closed (duplicate)

I believe that core should be responsible for drag and drop uploads (for all managed_file FAPI elements). See #1683838: Add HTML5 Drag & Drop upload to Field file and #625958: Support Uploading Multiple Files for HTML5 Browsers via #multiple attribute.

As slashrsm pointed out in #11, there are already a number of solutions which integrate with File entity for D7.