data/TWiki/TWikiUIUploadDotPm.txt
changeset 0 414e01d06fd5
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/data/TWiki/TWikiUIUploadDotPm.txt	Sat Jan 26 15:50:53 2008 +0100
     1.3 @@ -0,0 +1,38 @@
     1.4 +---+ Package =TWiki::UI::Upload=
     1.5 +
     1.6 +UI delegate for attachment management functions
     1.7 +
     1.8 +
     1.9 +%TOC%
    1.10 +
    1.11 +---++ StaticMethod *attach* <tt>($session)</tt>
    1.12 +
    1.13 +=attach= command handler.
    1.14 +This method is designed to be
    1.15 +invoked via the =UI::run= method.
    1.16 +
    1.17 +Generates a prompt page for adding an attachment.
    1.18 +
    1.19 +
    1.20 +
    1.21 +---++ StaticMethod *upload* <tt>($session)</tt>
    1.22 +
    1.23 +=upload= command handler.
    1.24 +This method is designed to be
    1.25 +invoked via the =UI::run= method.
    1.26 +CGI parameters, passed in $query:
    1.27 +
    1.28 +| =hidefile= | if defined, will not show file in attachment table |
    1.29 +| =filepath= | |
    1.30 +| =filename= | |
    1.31 +| =filecomment= | comment to associate with file in attachment table |
    1.32 +| =createlink= | if defined, will create a link to file at end of topic |
    1.33 +| =changeproperties= | |
    1.34 +| =redirectto= | URL to redirect to after upload. ={AllowRedirectUrl}= must be enabled in =configure=. The parameter value can be a =TopicName=, a =Web.TopicName=, or a URL. Redirect to a URL only works if it is enabled in =configure=. |
    1.35 +
    1.36 +Does the work of uploading a file to a topic. Designed to be useable for
    1.37 +a crude RPC (it will redirect to the 'view' script unless the
    1.38 +'noredirect' parameter is specified, in which case it will print a message to
    1.39 +STDOUT, starting with 'OK' on success and 'ERROR' on failure.
    1.40 +
    1.41 +