Attach multiple files at once by uploading a zip
archive. All files in the zip file will be attached to the topic.
LocalSite.cfg
or configure
- Test: zip
file to a topic IMPORTFILECOMMENTS
flag below is enabled and the archive contains corresponding file comments (in which case the latter take precedence).
FILECOMMENTFLAGS
flag below and adding prefixes of the form +h-l
(case insensitive, given in arbitrary order, to be separated from the 'main' description by at least one whitespace).
Plugin settings are stored as preferences variables. To reference a plugin setting write %<plugin>_<setting>%
, e.g., %BATCHUPLOADPLUGIN_SHORTDESCRIPTION%
Note: 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.
BatchUploadPlugin.zip
in your twiki installation directory. Content: File: | Description:![]() |
---|---|
data/TWiki/BatchUploadPlugin.txt | Documentation |
lib/TWiki/Plugins/BatchUploadPlugin.pm | Perl module |
configure
in your TWiki installation, and enable the plugin in the {Plugins} section.
Versions 1.2 and above include the ability to choose between attaching uploaded zip files, or extracting and attaching the contents. To add this feature to TWiki, add the following lines to the skin templates files, just after the hidefile
table entry:
templates/attach.pattern.tmpl
(attachform
section):
<input type="checkbox" class="twikiCheckbox" id="batchupload" checked name="batchupload" %BATCHUPLOADCHECKBOX% /><label for="batchupload">%MAKETEXT{"Batch upload for zip file"}%</label> <span class="twikiGrayText">%MAKETEXT{"Extracts and uploads individual file in zip archive."}%</span>
templates/attach.tmpl
and templates/attach.classic.tmpl
(content
section):
<tr> <td align="right"> Batch Upload: </td><td> <input type="checkbox" name="batchupload" %BATCHUPLOADCHECKBOX% />Extract Files and Attach them to the Topic </td> </tr>
In addition, add the following line to lib/LocalSite.cfg
:
$TWiki::cfg{Plugins}{BatchUploadPlugin}{usercontrol} = 1;
Plugin Author: | TWiki:Main.MartinCleaver, TWiki:Main.ArthurClemens | ||||||
Copyright ©: | TWiki:Main.MartinCleaver, TWiki:Main.ArthurClemens | ||||||
License: | GPL | ||||||
Dependencies: |
|
||||||
Plugin Version: | 09 Jul 2008 (v1.400) | ||||||
Change History: | |||||||
09 Jul 2008 | 1.4: TWiki:Main.MarkusUeberall: Added support for zip file comments. All individual files now inherit the hide and link flags in the same way they inherit the comment specified in the upload form. | ||||||
21 Mar 2007 | 1.3: TWiki:Main.ScottHoge: added usercontrol cfg, to allow global control of upload as in v1.1 |
||||||
20 Feb 2007 | 1.2: TWiki:Main.MartinRothbaum, TWiki:Main.SopanShewale: added option to enable/disable unzip-and-attach behavior via cgi parameter. | ||||||
23 Dec 2006 | 1.1: TWiki:Main.ArthurClemens: Cleaned up and repackaged. Zipped files are now checked against the TWiki upload filter - for instance php files will get a .txt extension; spaces in zipped filenames will be changed to underscores. If a comment is entered when uploading a zip, the comment text will be assigned to all new attachments. After successful upload you will no longer see an error screen. |
||||||
31 Oct 2004 | TWiki:Main.MartinCleaver - initial version as plugin | ||||||
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 Dependency: | $TWiki::Plugins::VERSION 1.024 | ||||||
CPAN Dependencies: | CPAN:Archive::Zip | ||||||
Other Dependencies: | none | ||||||
Perl Version: | 5.008 | ||||||
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