attachment upload
[openafs-wiki.git] / TWiki / TWikiUIUploadDotPm.mdwn
1 # <a name="Package &lt;code&gt;TWiki::UI::Upload="></a> Package =TWiki::UI::Upload
2
3 UI delegate for attachment management functions
4
5 <div>
6   <ul>
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>
10       </ul>
11     </li>
12   </ul>
13 </div>
14
15 ## <a name="StaticMethod &lt;strong&gt;attach&lt;/strong&gt; ($session)"></a> [[StaticMethod]] **attach** `($session)`
16
17 `attach` command handler. This method is designed to be invoked via the `UI::run` method.
18
19 Generates a prompt page for adding an attachment.
20
21 ## <a name="StaticMethod &lt;strong&gt;upload&lt;/strong&gt; ($session)"></a> [[StaticMethod]] **upload** `($session)`
22
23 `upload` command handler. This method is designed to be invoked via the `UI::run` method. CGI parameters, passed in $query:
24
25 <table border="1" cellpadding="0" cellspacing="0">
26   <tr>
27     <td><code>hidefile</code></td>
28     <td> if defined, will not show file in attachment table </td>
29   </tr>
30   <tr>
31     <td><code>filepath</code></td>
32     <td>   </td>
33   </tr>
34   <tr>
35     <td><code>filename</code></td>
36     <td>   </td>
37   </tr>
38   <tr>
39     <td><code>filecomment</code></td>
40     <td> comment to associate with file in attachment table </td>
41   </tr>
42   <tr>
43     <td><code>createlink</code></td>
44     <td> if defined, will create a link to file at end of topic </td>
45   </tr>
46   <tr>
47     <td><code>changeproperties</code></td>
48     <td>   </td>
49   </tr>
50   <tr>
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>
53   </tr>
54 </table>
55
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.