Personal tools
You are here: Home Web Plone Howto install collective.uploadify for Plone 3.1.x

Howto install collective.uploadify for Plone 3.1.x

Howto install collective.uploadify on a CentOS v5.x plone instance v3.1.x

Motivation

I have been using DAV to copy images (typically png screen snaps, or jpeg photos) to a plone site for inclusion in articles. This allows multiple images very quickly into a folder. However, I have found that the DAV client is uploading them with a mime type 'application/octet-stream', and they end up being of type 'file' in plone (they should be of type 'image' with a mime type of 'image/jpeg') [Note: this can be viewed in the ZMI by adding '/manage_main' to the end of the image URL]. When linking to those images within an article, the web browser doesn't show them correctly (and instead shows a save as file dialog).

This article is based on the collective uploadify instructions.

Prerequisites

'easy_install' is part of the python-setuptools rpm package.

# yum install python-setuptools

Installation

WARNING: This product doesn't support copying the package into '/var/lib/zope/Products'.

To install:

# easy_install collective.uploadify
# echo '<include package="collective.uploadify" />' > /var/lib/zope/etc/package-includes/collective.uploadify-configure.zcml
# service zope restart

To use the product, add '/@@upload' to any folder. i.e. go to http://your-plone-site/any-old-folder/@@upload. Use the 'browse' button to select one or more files. Then use the 'upload files' button to commit them.

Add a portal action

At this stage the upload is functional, but not very convienent. Use the ZMI to add an 'Upload' portal action. Browse to http://<plone.site>/portal_actions/object and press the 'Add' button to add a new CMF Action.

Plone add 'upload' portal action - 1.png

Enter an ID of 'upload' in the dialog:

Plone add 'upload' portal action - 2.png

Edit the upload port action with the details as follows:

Name Value
Title Upload
Description Batch upload files.
URL string:${plone_context_state/canonical_object_url}/@@upload
Condition python:plone_context_state.is_folderish() or plone_context_state.is_default_page()
Permissions
'add portal content'
Visible
checked

Plone add 'upload' portal action - 3.png

Now the plone site should have a new 'Upload' tab on folders, where the user can add portal content.

Plone site with 'upload' portal action tab

Usage

When no files have been selected for upload the control will be empty. Press the 'BROWSE' button to multi-selct files for upload.

collective-uploadify screen snap (with no files).png

Once files have been selected, they will appear in a list between the 'BROWSE' button, and the 'Upload files' button.

collective.uploadify with one file.png

 

Links

Appendices

Easy Install

# easy_install collective.uploadify
Searching for collective.uploadify
Reading http://cheeseshop.python.org/pypi/collective.uploadify/
Reading http://svn.plone.org/svn/collective/collective.uploadify
Reading http://cheeseshop.python.org/pypi/collective.uploadify/1.0rc4
Best match: collective.uploadify 1.0rc4
Downloading 
http://pypi.python.org/packages/source/c/collective.uploadify/collective.uploadify-1.0rc4.zip#md5=53f0f44ff2119c37cc05759d459201ae
Processing collective.uploadify-1.0rc4.zip
Running collective.uploadify-1.0rc4/setup.py -q bdist_egg --dist-dir
/tmp/easy_install-53WAZM/collective.uploadify-1.0rc4/egg-dist-tmp-I0Zv94
/usr/lib64/python2.4/distutils/dist.py:236: UserWarning: Unknown distribution option: 'paster_plugins'
  warnings.warn(msg)

Adding collective.uploadify 1.0rc4 to easy-install.pth file

Installed /usr/lib/python2.4/site-packages/collective.uploadify-1.0rc4-py2.4.egg
Processing dependencies for collective.uploadify

 

Document Actions