1 # <a name="Package <code>TWiki::UI::Upload="></a> Package =TWiki::UI::Upload
3 UI delegate for attachment management functions
7 <li><a href="#Package =TWiki::UI::Upload="> Package TWiki::UI::Upload</a><ul>
8 <li><a href="#StaticMethod <strong>attach</strong> ($session)"> StaticMethod attach <tt>($session)</tt></a></li>
9 <li><a href="#StaticMethod <strong>upload</strong> ($session)"> StaticMethod upload <tt>($session)</tt></a></li>
15 ## <a name="StaticMethod <strong>attach</strong> ($session)"></a> [[StaticMethod]] **attach** `($session)`
17 `attach` command handler. This method is designed to be invoked via the `UI::run` method.
19 Generates a prompt page for adding an attachment.
21 ## <a name="StaticMethod <strong>upload</strong> ($session)"></a> [[StaticMethod]] **upload** `($session)`
23 `upload` command handler. This method is designed to be invoked via the `UI::run` method. CGI parameters, passed in $query:
25 <table border="1" cellpadding="0" cellspacing="0">
27 <td><code>hidefile</code></td>
28 <td> if defined, will not show file in attachment table </td>
31 <td><code>filepath</code></td>
35 <td><code>filename</code></td>
39 <td><code>filecomment</code></td>
40 <td> comment to associate with file in attachment table </td>
43 <td><code>createlink</code></td>
44 <td> if defined, will create a link to file at end of topic </td>
47 <td><code>changeproperties</code></td>
51 <td><code>redirectto</code></td>
52 <td> URL to redirect to after upload. <code>{AllowRedirectUrl}</code> must be enabled in <code>configure</code>. The parameter value can be a <code>TopicName</code>, a <code>Web.TopicName</code>, or a URL. Redirect to a URL only works if it is enabled in <code>configure</code>. </td>
56 Does the work of uploading a file to a topic. Designed to be useable for a crude RPC (it will redirect to the 'view' script unless the 'noredirect' parameter is specified, in which case it will print a message to STDOUT, starting with 'OK' on success and 'ERROR' on failure.