| Module name |
upload UploadCgiScript |
| Location |
TWIKIROOT/bin/upload |
| Summary |
Used to implement the uploading of attachments |
| Primary Author |
NicholasLee |
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:
This section lists the methods that can be used by the scripts and by other modules
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