Pure javascript files upload tool for Plone, with drag and drop, multi selection, and progress bar.
Project description
Description
This product offers a multiple files upload tool for Plone, with multi selection, drag and drop, and progress bar. A pure javacript tool is used on client side, with html5 file fields and ajax upload for modern browsers, and a graceful fallback for other browsers. You can also choose to replace the javascript with jquery.uploadify, a flashupload based script which could be interesting in rare situations (Plone site for MSIE client’s browsers only, without http authentication in front, and no https).
To install it in your buildout, just add ‘collective.quickupload’ to your egg list, then
>> bin/buildout
To install it in Plone, use the Addons control panel, select “Plone Quick Upload” Product and install it.
To see it in action, just assign the Quick Upload portlet somewhere in your site and test it.
Details
This package contains :
collective.quickupload.browser
A simple ajax view that can be called by any plone template.
This view is using a javascript multiple upload tool based on fileuploader.js (a fork with many ameliorations of http://valums.com/ajax-upload/) OR jquery.uploadify.js (based on flashupload, see also collective.uploadify plone product from which some parts of code have been taken)
By default the javascript only method is used : the fileuploader.js is a pure ajax file uploader which uses html5 multiple file fields and ajax upload post method. It’s not a jquery plugin. For modern browsers like FireFox 3.6+, Chrome, or Safari 4+, it offers drag and drop, multi-selection, and progress bar during upload. For other browsers (IE7, IE8, …), the script offers a graceful hidden iframe upload fall back.
Flashupload (jquery.uploadify) is more user friendly under MSIE, but has some “big” problems :
cannot be used behind any kind of http authentication (basic authentication, windowsNT authentication, …)
cannot be used through https
not open source
the webmaster has the choice between these 2 solutions (see control panel below).
the upload form can be viewed only with permission CMF.AddPortalContent on context
the upload form can be viewed only for objects providing IQuickUploadCapable, by default ATFolder, ATBTreeFolder and Plone Site are implementing IQuickUploadCapable
the quickupload form allows to fill title for each uploaded file (see control panel below)
the quickupload view log and returns errors to the form (unauthorized, id always exist, type not allowed, etc … )
the view can use some attributes set in session or request:
- force mediatype (could be None, image, video, audio, or something like this '*.pdf;*.doc;')if a mediatype is set in request :
with fileuploader.js an error is raised in the form when a file content-type selected is not correct.
with Flashupload, only choosed content types are shown in selection window, with a specific message “select images”, “select video files” (…).
force portal_type
if portal_type is not set in request, content_type_registry is used to find the good portal_type, otherwise the “File” portal_type will be used.
a basic Plone Control panel with some options:
- use flashupload (yes/no), default = no - fill file's titles in form (yes/no), default = yes - automatic upload on select (yes/no), default=no - max size limit for each file in KB (default= 0 = no limit) - simultaneous uploads limit (default=2, 0 = no limit)
collective.quickupload.portlet
a portlet calling the quickupload ajax view (it’s also an example on how to use the quick_upload view)
the portlet is not assigned (can be done TTW or in another package)
collective.quickupload.profiles
control panel GS profile
the javascript and css registry GS profile
portlet GS profile
quickupload.tests
doctests for control panel, portlet, and quick_upload view
Compliance
Plone 3.3.x, Plone4
About fileuploader.js fork
These ameliorations have been done :
queue uploads
graphic progress bar
simultaneous upload limit
can send all files in a second time, after multiple selections, and after different actions on form.
can add new fields using a new method (onAfterSelect), associated to each file
debugMode and debugConsole
css improvements
How To
How to add the quickupload view in my own template or viewlet ?
Just look the quickupload portlet code, it’s really easy.
You can also take a look at collective.plonefinder product http://plone.org/products/collective.plonefinder which requires collective.quickupload.
TODO
javascript client tests
unit tests for upload methods
fileuploader.js refactorisation using jquery
Support
A tracker will be open at http://plone.org/products/collective.quickupload/
SVN
https://svn.plone.org/svn/collective/collective.quickupload/
More Information
Jean-mat Grimaldi http://macadames.wordpress.com
Thanks to :
Adrew Valumns (for original fileuploader.js),
Ramon Bartl (for some parts of code taken in collective.uploadify Plone product),
Ronnie Garcia, Travis Nickels (for jquery.uploadify.js)
Gilles Lenfant David Pack and Christophe Combelles, Alter Way Solutions, for functional tests, ideas, and moral support.
Changelog
1.0.2
IE7 css fixes upload button was uggly macadames 2010-09-22
fix content-type header with FireFox xhr upload sometimes is missing macadames 2010-09-24
don’t use unicode in setFileName because it break Archetypes File Field download (unicode decode error) macadames 2010-09-24
minor fixes in medialabel for upload macadames 2010-09-26
1.0.1
fix set_id or check_id methods now called on context, no more on aq_parent(context) macadames 2010-09-14
slow down the removing of progressBar to see something even when Plone is too fast :-) macadames 2010-09-15
try to find the good content_type for uploaded files using plone mime_types_registry when mimetypes.guess_type(file_name) returns (None, None) macadames 2010-09-17
fix strange ATFile behavior with content_types when passing mutator(data, content_type=content_type) the content_type is not always good macadames 2010-09-17
Don’t use unicode in setFileName macadames 2010-09-24
fix content-type header with FireFox xhr upload sometimes is missing macadames 2010-09-24
1.0.0
fix jquery.uploadify on MSIE with a temp workaround see ticket : https://dev.plone.org/plone/ticket/10894 macadames - 2010/09/02
using different ids for each uploader methods launchers since we could have different uploaders in a same page example : an images uploader portlet, a video uploader portlet macadames - 2010/09/02
remove the cookie authentication method with jquery.uploadify (it’s not secure to send the cookie in all requests) Just keep the old PloneFlashUpload method (ticket) macadames - 2010/09/02
many improvements around fileuploader.js (fork) : autoUpload option added onAfterSelect option added refactoristion with these new options macadames - 2010/09/02
added fileuploader.js jscript launcher macadames - 2010/08/25
change flashupload jscript launchers to allow multiple uploaders in same page macadames - 2010/08/25
Add fileuploader.js for XHR or simple hidden iframe uploader macadames - 2010/08/25
Add quick upload control panel macadames - 2010/08/25
Initial release : extract upload code from collective.plonefinder to make a separate package macadames - 2010/08/25
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for collective.quickupload-1.0.2.zip
Algorithm | Hash digest | |
---|---|---|
SHA256 | 50a30246b0d7288fe33819a0c1e84087d3b992c84f71c87d78310bcc5dba09d3 |
|
MD5 | 37f5fa544ed7993c5ddaa257fe115003 |
|
BLAKE2b-256 | 31ef675d91b38cdc596341de1d18c3def040290b08f2a0bc77d862083951575c |
Hashes for collective.quickupload-1.0.2-py2.6.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1f3bd91bc33a0da700578219b46d060e4b6bb617f2e2977dd40782616afa79c8 |
|
MD5 | a79dd49341b1529c38860e9e39e9f98a |
|
BLAKE2b-256 | 51642705b8fbb62a4e523511a415abe0b615bad5bcbe9aed70abed7a104304f7 |