TWiki
>
TWiki/ Web
>
BatchUploadPlugin
(31 Oct 2004,
TWikiContributor
)
(raw view)
E
dit
A
ttach
---+!! Batch Upload Plugin *Attach multiple files at once by uploading a =zip= archive.* All files in the zip file will be attached to the topic. ---++ Usage * Enable this plugin in =LocalSite.cfg= or =configure= - Test: %IF{"context BatchUploadPluginEnabled" then='%ICON{choice-yes}% !BatchUploadPlugin is enabled' else='%ICON{choice-no}% !BatchUploadPlugin is not enabled. Enable this plugin below.'}% * Attach a =zip= file to a topic * If a comment is entered with the zip file, the comment will be assigned to all contained files unless the =IMPORTFILECOMMENTS= flag below is enabled and the archive contains corresponding file comments (in which case the latter take precedence). * Using archive file comments, it is possible to specifiy hide and/or link flags on a file-per-file basis which override those given in the upload form by enabling the =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 * Debug plugin * Set DEBUG = 0 * Enabled state - if disabled, does nothing * Set ENABLED = 1 * File comments in archives will be imported (and override the default comment specified in the upload form) * Set IMPORTFILECOMMENTS = 1 * File comments in archives may contain prefixes (see above) which override specified default hide and link flags (this flag is independent from the previous one; if it is disabled, existing prefixes will not be stripped from imported comments) * Set FILECOMMENTFLAGS = 1 * Set SHORTDESCRIPTION = Attach multiple files at once by uploading a zip archive Plugin settings are stored as preferences variables. To reference a plugin setting write ==%<plugin>_<setting>%==, e.g., ==%<nop>BATCHUPLOADPLUGIN_SHORTDESCRIPTION%== ---++ Caveats * Contents of nested zips will only be attached partially ---++ Further Development * Support nested zips * Support interactive modification of hide and link attributes on a file-per-file basis during archive import * Support other archive formats (e.g., tar) ---++ Plugin Installation Instructions __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. * Download the ZIP file from the Plugin web (see below) * Unzip ==%TOPIC%.zip== in your twiki installation directory. Content: | *File:* | *Description:* | | ==data/TWiki/BatchUploadPlugin.txt== | Documentation | | ==lib/TWiki/Plugins/BatchUploadPlugin.pm== | Perl module | * (Dakar) Visit =configure= in your TWiki installation, and enable the plugin in the {Plugins} section. * Flip ENABLED switch to 1 * Test if the installation was successful: * Try uploading a zip file ---+++ Conditional Batch Upload 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): <blockquote> <verbatim> <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> </verbatim> </blockquote> * =templates/attach.tmpl= and =templates/attach.classic.tmpl= (=content= section): <blockquote> <verbatim> <tr> <td align="right"> Batch Upload: </td><td> <input type="checkbox" name="batchupload" %BATCHUPLOADCHECKBOX% />Extract Files and Attach them to the Topic </td> </tr> </verbatim> </blockquote> In addition, add the following line to =lib/LocalSite.cfg=: <blockquote> <verbatim> $TWiki::cfg{Plugins}{BatchUploadPlugin}{usercontrol} = 1; </verbatim> </blockquote> ---++ Plugin Info | Plugin Author: | TWiki:Main.MartinCleaver, TWiki:Main.ArthurClemens | | Copyright ©: | TWiki:Main.MartinCleaver, TWiki:Main.ArthurClemens | | License: | [[http://www.gnu.org/copyleft/gpl.html][GPL]] | | Dependencies: | <table border="1"><tr><th>Name</th><th>Version</th><th>Description</th></tr><tr><td align="left">Archive::Zip</td><td align="left">>=1.18</td><td align="left">Required.</td></tr></table> | | Plugin Version: | 09 Jul 2008 (v1.400) | | Change History: | <!-- versions below in reverse order --> | | 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: | %TWIKIWEB%.GoodStyle nn%, %TWIKIWEB%.FormattedSearch nn%, %TOPIC% nn% | | Plugin Home: | http://TWiki.org/cgi-bin/view/Plugins/%TOPIC% | | Feedback: | http://TWiki.org/cgi-bin/view/Plugins/%TOPIC%Dev | __Related Topics:__ %TWIKIWEB%.TWikiPreferences, %TWIKIWEB%.TWikiPlugins
E
dit
|
A
ttach
|
P
rint version
|
H
istory
: r1
|
B
acklinks
|
V
iew topic
|
Ra
w
edit
|
M
ore topic actions
Topic revision: r1 - 31 Oct 2004 - 13:51:52 -
TWikiContributor
TWiki/
Log In
or
Register
TWiki/ Web
Users
Groups
Index
Search
Changes
Notifications
RSS Feed
Statistics
Preferences
User Reference
ATasteOfTWiki
TextFormattingRules
TWikiVariables
FormattedSearch
QuerySearch
TWikiDocGraphics
TWikiSkinBrowser
InstalledPlugins
Admin Maintenance
Reference Manual
AdminToolsCategory
InterWikis
ManagingWebs
TWikiSiteTools
TWikiPreferences
WebPreferences
Categories
Admin Documentation
Admin Tools
Developer Doc
User Documentation
User Tools
Webs
Abacos
Acbahia
AnpedGT16
ArcoDigital
Argumento
Avsan
CalculoB
Ceb
Cetad
CetadObserva
Cibercultura
Ciberfem
CiberParque
ColoquioCiags
Coloquiofasa
ConexoesSaberes
Cpdteste
Cppd
Creche
Cridi
Da
DACN
DCE
DelzaTeste
DeniseCarla
DepHistoria
DicionarioBelasartes
Ecologia
EDC
Educandow
EduMus
EleicoesReitor2010
Encima
Enearte
Estruturas
EstruturasEng
FACED
FAT
FepFaced
GEC
GeneticaBiodiversidade
GeneticaBiodiversidade3
GeneticaBiodiversidade
Gepindi
GetecEng
Godofredofilho
GrupoAlgebra
ICI010
Informev
Ites
LabioComp
LEG
Lepeja
Letras
LivroLivreSalvador
Main
MaisUm
Mata07
Mefes
MefesCpd
MetaReciclagem
Neclif
NelsonPretto
Nuclear
Numcad
Nutricao
Observa
OrfaosdeRua
PauloCostaLima
PdI
PescandoLetras
PETFilosofia
Pgif
PGNUT
PortalPpga
PosCultura
Pospetroigeo
PPGAC
PPGE
PpggBio
Ppggenbio
Pretto
Proad
PROGESP
ProjetoLencois
Quimica
RadioFACED
RadioTeatro
RadioWeb
Riosymposium10
Ripe
Salasdoctai
Sat
Sedu
SemBio
SeminarioPibid
SimoneLucena
Sociologia
SSL
Tabuleiro
TabuleirosUfba
TCinema
TerritoriosDigitais
TWiki
Twikidea
UFBAIrece
UniversidadeNova
VizinhoEstrangeiro
XIISNHCT
Български
English
Español
日本語
Português
Copyright � by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback