r1 - 31 Oct 2004 - 16:51:52 - MartinCleaverYou are here: TWiki >  TWiki Web  > BatchUploadPlugin

BatchUploadPlugin

This plugin processes a zip file, attaching each of the individual files contained in the zip so that those files rather than the zip end up attached to the designated topic.

Improvements over the 2004 Cairo version:

  • Better display when completed: it no longer looks like an error message when it completes
  • If INHIBITZIPFILEUPLOAD is = 1 (this is the default) then the .ZIP file does not get attached, only the contents of the ZIP. If it is = 0 then you get both the zip file and the contents attached.
  • This version no longer breaks the TWiki::UI::Upload encapsulation as the required entry point now exists in TWiki::Func
  • It is enabled by default.

This version of the plugin does not work on TWiki:Codev.TWikiRelease04Sep2004 (Cairo).

Syntax Rules

  • None - it applies as long as it is enabled. (Off by default)

Examples

  • Upload a zip file - instead of the zip being attached, the files it contains will be attached.

Plugin Settings

Plugin settings are stored as preferences variables. To reference a plugin setting write %<plugin>_<setting>%, e.g., %BATCHUPLOADPLUGIN_SHORTDESCRIPTION%

  • One line description, is shown in the TextFormattingRules topic:
    • Set SHORTDESCRIPTION = Plugin for attaching all files in a ZIP instead of the zip itself

  • Debug plugin: (See output in data/debug.txt)
    • Set DEBUG = 0

  • If disabled, does nothing.
    • Set ENABLED = 1

  • If INHIBITZIPFILEUPLOAD = 1 then ZIP files won't be uploaded, only their contents will be stored
    • Set INHIBITZIPFILEUPLOAD = 1

Plugin Installation Instructions

Note: As an end-user you do not need to install anything on the browser to use this plugin. The following instructions are for the administrator who installs the plugin on the server where TWiki is running.

  • Download the ZIP file from the Plugin web (see below)
  • Unzip BatchUploadPlugin.zip in your twiki installation directory. Content:
    File: Description:
%$MANIFEST%
  • (Dakar) Visit configure in your TWiki installation, and enable the plugin in the {Plugins} section.
  • Test to see whether the installation was successful:
    • try uploading a zip file: the content should end up on the test page.

Caveats

  • This is a DAKAR ONLY version. It does not work on CAIRO installs
  • It breaks the TWiki::Sandbox encapsulation as TWiki::Sandbox::sanitizeAttachmentName is not available though TWiki::Func
  • Comment field on extracted files is not customisable
  • It may silently rename uploaded files, because it has no means to notify the user of changes it makes to file names

Further Development

  • Make one release that works with both pre- and post- Dakar TWikis.
  • TWiki:Codev.BeforeAttachmentSaveHandler needs veto capability, the plugin terminates TWiki abruptly
  • Error messages / reporting should be given to the user and made multi-lingual
  • Test what happens if you upload a zip containing zips

Plugin Info

Plugin Author: TWiki:Main.MartinCleaver
Plugin Version: 13 Sep 2006 (V1.1)
Change History:  
13 Sep 2006 TWiki:Main.MartinCleaver - work to port to TWiki-4 sponsored by BMW Oracle Racing
31 Oct 2004 TWiki:Main.MartinCleaver - initial version as plugin, TWiki:Codev.BeforeAttachmentSaveHandler
09 Apr 2004 TWiki:Main.DiabJerius
17 Nov 2003 TWiki:Main.JohannesMartin
20 Mar 2003 TWiki:Main.RonKellam
16 Aug 2002 TWiki:Main.ThomasWeigert
14 Jan 2002 TWiki:Main.RyanFreebern
30 Oct 2001 TWiki:Main.VitoMiliano (TWiki:Codev.MultipleAttachmentsAtOnce)
TWiki Dependency: $TWiki::Plugins::VERSION 1.1
CPAN Dependencies: CPAN:Archive::Zip
Other Dependencies: none
Perl Version: 5.005
TWiki:Plugins/Benchmark: GoodStyle nn%, FormattedSearch nn%, BatchUploadPlugin nn%
Plugin Home: http://TWiki.org/cgi-bin/view/Plugins/BatchUploadPlugin
Feedback: http://TWiki.org/cgi-bin/view/Plugins/BatchUploadPluginDev

Related Topics: TWikiPreferences, TWikiPlugins

-- TWiki:Main/MartinCleaver - 31 Oct 2004

Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r1 | More topic actions
 
Powered by TWiki
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback
Note: Please contribute updates to this topic on TWiki.org at TWiki:TWiki.BatchUploadPlugin