Tags:
create new tag
view all tags
Module name upload UploadCgiScript
Location TWIKIROOT/bin/upload
Summary Used to implement the uploading of attachments
Primary Author NicholasLee

CVS history http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/twiki/twiki/bin/upload
CVS alpha http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/twiki/twiki/bin/upload?rev=HEAD&content-type=text/vnd.viewcvs-markup
Contributing authors (see CVS History)
IsClass NO - is FatCgiScript
First TWikiRelease twiki-19990701-release

Purpose

To handle a POST request where the payload contains details about the file to attach and its destination. See the notes at the top of the script for details on the parameters

Used by

TWiki Modules used

This CGI script depends on the following TWiki modules for functionality:

External Modules used

This CGI script also depends on the following external modules:

  • File::Copy

PublicMethods

This section lists the methods that can be used by the scripts and by other modules

  • none

PrivateMethods

These do not need to be not documented yet

Please see CodevDocumentationProject and CodevDocumentationProjectDev for comments on the format of these pages.

-- MartinCleaver - 23 Jun 2002

This script is considered a FatCgiScript because:

  • There exists many routines to deal with extracting the image size from a picture.
    • This probably duplication of a CPAN Module, if so, depend on that instead.
    • If not, this code would be better in a backend TWiki module
  • The routine addLinkToEndOfTopic is arguably better in StoreDotPm (or a TopicDotPm)
  • The block starting if {! $doChangeProperties } might be better in the back-end.

-- MartinCleaver - 24 Jun 2002

The upload script does not generate images sizes of PNGs. I've created a patch file so that PNG files are now supported too. See UploadDoesNotGenerateImageSizeOfPngs

-- ArthurClemens - 13 Sep 2003

I am investigating automating attachments with curl and thought that I would put my notes here. I am using the 20040730beta.

The form parameters are

  • input/hidden filename
  • input/file filepath
  • input/text filecomment
  • input/checkbox createlink
  • input/checkbox hidefile
  • input/submit no name, the button labeled "Upload file"

Therefore, a valid curl commandline would be curl -F "filename=" -F "filepath=@SOMEFILE" -F "filecomment=" TWIKIURL/Web/Topic

You would probably also use authentication with --user and possibly --digest. The filename parameter is blank for new attachments and is the name of the file for existing attachments. The checkbox parameters are not sent if unchecked, and would be -F "createlink=on" otherwise. If you try to post to a topic that does not exist, then you will be redirected to an oops page.

-- DanielDulay - 19 Aug 2004

Edit | Attach | Watch | Print version | History: r8 < r7 < r6 < r5 < r4 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r8 - 2006-05-04 - SamHasler
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.