r3 - 14 Jul 2007 - 21:49:28 - PeterThoenyYou are here: TWiki >  Plugins Web > UploadToTWikiAddOn
Tags:
admin_tool 2 Add my vote for this tag, attachments 4 Add my vote for this tag, automation 2 Add my vote for this tag, import 4 Add my vote for this tag, shell 1 Add my vote for this tag, web_application 1 Add my vote for this tag, , create new tag

Upload to TWiki Add-On

This is a small Perl script to programmatically attach a file to any TWiki topic. The script can be executed on any computer, it does not have to be on the server where TWiki is installed. This is a useful script to create mashups of TWiki and other applications.

Usage

To attach a file to a TWiki topic, type this on the command line:

./uploadtotwiki.pl -l <login> -c <comment> <file(s)> <TWiki URL>
and enter the password when prompted.

Supported command line parameters:

  • -l login      - login name of TWiki account (optional)
  • -p password   - password of TWiki account (optional)
  • -c 'comment'  - comment of attached file (default: 'Uploaded by uploadtotwiki/2007-02-12')
  • -h 1          - hide attachment, 0 or 1 (default: 0)
  • -i 1          - inline attachment, e.g create link in topic text (default: 0)
  • -d 60         - delay in seconds between uploads of multiple files (default: 30)
  • file(s)       - one or more local files to upload (required)
  • URL           - view URL of TWiki topic, http or https protocol (required, must be last)

Example:

% ./uploadtotwiki.pl -l guest ./smile.gif http://twiki.org/cgi-bin/view/Sandbox/UploadTest
Uploading ./smile.gif to http://twiki.org/cgi-bin/view/Sandbox/UploadTest
Enter password for guest at twiki.org:
... upload finished.
%

Add-On Installation Instructions

Note: This is a command line tool for administrators; regular TWiki user can ignore this.

  • Download the ZIP file from the Add-on Home (see below)
  • Unzip UploadToTWikiAddOn.zip in your twiki installation directory. Content:
    File: Description:
    data/TWiki/UploadToTWikiAddOn.txt Add-on topic
    tools/uploadtotwiki.pl Add-on script
  • If inclined, move uploadtotwiki.pl to a different location or server
  • Run above example to test if the installation was successful
  • Install CPAN:LWP if needed (see instructions)

Limitations

  • Upload of files with illegal characters ($, @, ^, space, etc.) fail, and no error message is shown.

Add-On Info

  • Set SHORTDESCRIPTION = Script to programmatically attach a file to any TWiki topic

Add-on Author: TWiki:Main.PeterThoeny
Copyright: © 2007, TWiki:Main.PeterThoeny, StructuredWikis LLC
License: GPL (GNU General Public License)
Add-on Version: uploadtotwiki/2007-02-12
Change History:  
2007-02-12: Added -l, -p, -c, -h, -i, -d parameters; support for multiple files
2007-02-11: Initial version
TWiki Dependency: $TWiki::Plugins::VERSION 1.1 (TWiki 4.0)
CPAN Dependencies: LWP
Other Dependencies: none
Perl Version: 5.005
Add-on Home: http://TWiki.org/cgi-bin/view/Plugins/UploadToTWikiAddOn
Feedback: http://TWiki.org/cgi-bin/view/Plugins/UploadToTWikiAddOnDev
Appraisal: http://TWiki.org/cgi-bin/view/Plugins/UploadToTWikiAddOnAppraisal

Related Topic: TWikiAddOns

-- TWiki:Main/PeterThoeny - 2007-02-12

Topic attachments
I Attachment Action Size Date Who Comment
elsemd5 UploadToTWikiAddOn.md5 manage 0.2 K 13 Feb 2007 - 08:35 PeterThoeny  
ziptgz UploadToTWikiAddOn.tgz manage 12.4 K 13 Feb 2007 - 08:35 PeterThoeny  
zipzip UploadToTWikiAddOn.zip manage 13.7 K 13 Feb 2007 - 08:35 PeterThoeny  
elseEXT UploadToTWikiAddOn_installer manage 29.5 K 13 Feb 2007 - 08:35 PeterThoeny  
Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r3 < r2 < 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 SourceForge.net Logo