You are here: TWiki> Plugins Web>UploadToTWikiAddOn (2007-07-14, PeterThoeny)
Tags:
admin_tool2Add my vote for this tag attachments4Add my vote for this tag automation2Add my vote for this tag import4Add my vote for this tag shell1Add my vote for this tag web_application1Add my vote for this tag create new tag
, view all tags

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 2007-02-13 - 08:35 PeterThoeny  
ziptgz UploadToTWikiAddOn.tgz manage 12.4 K 2007-02-13 - 08:35 PeterThoeny  
zipzip UploadToTWikiAddOn.zip manage 13.7 K 2007-02-13 - 08:35 PeterThoeny  
elseEXT UploadToTWikiAddOn_installer manage 29.5 K 2007-02-13 - 08:35 PeterThoeny  
Topic revision: r3 - 2007-07-14 - 21:49:28 - PeterThoeny
 
TWIKI.NET
This site is powered by the TWiki collaboration platform
Ideas, requests, problems regarding TWiki? Send feedback
Copyright © 1999-2009 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.