diff options
Diffstat (limited to 'TWiki')
-rw-r--r-- | TWiki/FileAttachment.mdwn | 216 |
1 files changed, 180 insertions, 36 deletions
diff --git a/TWiki/FileAttachment.mdwn b/TWiki/FileAttachment.mdwn index e5f8d352..556a45fb 100644 --- a/TWiki/FileAttachment.mdwn +++ b/TWiki/FileAttachment.mdwn @@ -1,52 +1,196 @@ -## <a name="Dev_Reorg_Note_"> Dev Reorg Note: </a> +%TOC% %STARTINCLUDE% -The latest version of FileAttachments includes attachments under revision control. It's in the 01 Sep 2001 TWiki release. +## <a name="File_Attachments"> File Attachments </a> -* Current Dev topic: [[Codev/AttachmentsUnderRevisionControl]] +Each topic can have files attached to it. This is similar to an e-mail attachment. Just use your browser to upload or download a file. Attachments are stored under revision control - no upload is lost. ----- +### <a name="What_Are_Attachments_Good_For_"> What Are Attachments Good For? </a> -Each topic can have files attached to it. This is similar to an e-mail attachment. Just use your browser to upload or download a file. +#### <a name="Document_Management_System"> Document Management System </a> -* To upload: Click on the Attach link at the bottom of each page. A form is shown where you can browse for a file and upload it. The uploaded file will show up in the FileAttachment table. -* To download: Click on the file in the FileAttachment table. +* **_document management system: distribution, revision_** -**FileAttachment table** +#### <a name="File_Sharing"> File Sharing </a> + +* **_share files: applications, data files; recommended for light use_** + +#### <a name="Page_Content"> Page Content </a> + +* **_on-site use: linking to graphics, docs_** + +### <a name="Uploading_Files"> Uploading Files </a> + +* To upload: Click on the Attach link at the bottom of each page. A form is shown where you can browse for a file and upload it. The uploaded file will show up in the File Attachment table. +* Files of any type can be uploaded. Some files that might impose a security risk are renamed, i.e. `*.php` files are renamed to `*.php.txt`. +* Currently there is no file size limit besides the disk space on the server. +* The previous upload path is retained for convenience. In case you make some changes to the local file and want to upload it again you can copy the previous upload path into the Local file field. + +### <a name="Downloading_Files"> Downloading Files </a> + +* To download: Click on the file in the File Attachment table. +* There is no access control on individual attachments. If you need to have this type of control create separate topics and define access restrictions on the topics. + +### <a name="Moving_Attachment_Files"> Moving Attachment Files </a> + +An attachement can be moved between topics. To do this click _action_ on the attachment to be moved. On the subsequent page select the new Web and Topic, the click _Move_. The attachment and its version history is moved. The original location is stored in the [[TWikiDocumentation]]. + +### <a name="Deleting_Attachments"> Deleting Attachments </a> + +It is not possible to delete attached files with the current TWiki implementation. However, they can be moved to another topic. You may care to have a topic **Trash.TrashAttachments** - move attachments that are no longer wanted here. + +### <a name="Linking_to_Attached_Files"> Linking to Attached Files </a> + +* Once a file is attached it can be referenced in the topic. Example: + * Attach file: `Sample.txt` + * Edit topic and write text: <code>%ATTACHURL%/Sample.txt</code> + * Text is shown as: %PUBURL%/%WEB%/%TOPIC%/Sample.txt, ex: it is a link. + * To reference an attachment located in another topic write text: + * <code>%PUBURL%/%WEB%/OtherTopic/Sample.txt</code> (for same web) + * <code>%PUBURL%/Otherweb/OtherTopic/Sample.txt</code> (for different web) + +* Attached HTML files and text files can be inlined in a topic. Example: + * Attach file: `Sample.txt` + * Edit topic and write text: <code>%INCLUDE\{"%ATTACHURL%/Sample.txt"\}%</code> + * Content of attached file is shown inlined. + * Read more in [[IncludeTopicsAndWebPages]]. + +* GIF, JPG and PNG images can be attached and shown embedded in a topic. Example: + * Attach file: `Smile.gif` + * Edit topic and write text: <code>%ATTACHURL%/Smile.gif</code> + * Text is shown as: %PUBURL%/%WEB%/%TOPIC%/Smile.gif , it shows up as an image. + +<a name="FileAttachmentTable"></a> + +### <a name="File_Attachment_Contents_Table"> File Attachment Contents Table </a> Is a table that looks like this: -<table border="0" cellpadding="0" cellspacing="4"> - <tr bgcolor="#99CCCC"> - <th>FileAttachment: </th> - <th> Action: </th> - <th> Size: </th> - <th> Date: </th> - <th> Who: </th> - <th> Comment: </th> - </tr> +<table border="1" cellpadding="20" cellspacing="0"> <tr> - <td> (attached file) </td> - <td> (view, update, add) </td> - <td> (file size) </td> - <td> (upload date) </td> - <td> (uploaded by) </td> - <td> (file comment) </td> + <td> + <table border="1" cellpadding="1" cellspacing="0"> + <tr> + <th align="center" bgcolor="#99CCCC"><strong><a href="FileAttachment">Attachment</a>:</strong></th> + <th align="center" bgcolor="#99CCCC"><strong>Action:</strong></th> + <th align="center" bgcolor="#99CCCC"><strong>Size:</strong></th> + <th align="center" bgcolor="#99CCCC"><strong>Date:</strong></th> + <th align="center" bgcolor="#99CCCC"><strong>Who:</strong></th> + <th align="center" bgcolor="#99CCCC"><strong>Comment:</strong></th> + </tr> + <tr> + <td><img align="top" height="16" src="%PUBURLPATH%/icn/txt.gif" width="16" /> <a href="%SCRIPTURLPATH%/viewfile%SCRIPTSUFFIX%/TWiki/FileAttachment?rev=&filename=Sample.txt">Sample.txt</a></td> + <td><a href="%SCRIPTURLPATH%/attach%SCRIPTSUFFIX%/TWiki/FileAttachment?filename=Sample.txt&revInfo=1">action</a></td> + <td> 30 </td> + <td> 22 Jul 2000 - 19:37 </td> + <td><a href="PeterThoeny">PeterThoeny</a></td> + <td> Just a sample </td> + </tr> + <tr> + <td><img align="top" hight="16" src="%PUBURLPATH%/icn/bmp.gif" width="16" /> <a href="%SCRIPTURLPATH%/viewfile%SCRIPTSUFFIX%/TWiki/FileAttachment?rev=&filename=Smile.gif">Smile.gif</a></td> + <td><a href="%SCRIPTURLPATH%/attach%SCRIPTSUFFIX%/TWiki/FileAttachment?filename=Smile.gif&revInfo=1">action</a></td> + <td> 94 </td> + <td> 22 Jul 2000 - 19:38 </td> + <td><a href="PeterThoeny">PeterThoeny</a></td> + <td> Smiley face </td> + </tr> + </table> + </td> </tr> </table> -**Action** is: +### <a name="File_Attachment_Control_Page"> File Attachment Control Page </a> -* **view:** View file. This is the same as clicking on the filename. -* **update:** Update file that is already attached. -* **add:** Add a new attachment. +Clicking on an action link takes you to a new page that looks like this: -**Remarks** +<form> + <table border="1" cellpadding="20" cellspacing="0"> + <tr> + <td> + <table border="1" cellpadding="1" cellspacing="0"> + <tr> + <th align="center" bgcolor="#99CCCC"><strong><a href="FileAttachment">Attachment</a>:</strong></th> + <th align="center" bgcolor="#99CCCC"><strong>Action:</strong></th> + <th align="center" bgcolor="#99CCCC"><strong>Size:</strong></th> + <th align="center" bgcolor="#99CCCC"><strong>Date:</strong></th> + <th align="center" bgcolor="#99CCCC"><strong>Who:</strong></th> + <th align="center" bgcolor="#99CCCC"><strong>Comment:</strong></th> + <th align="center" bgcolor="#99CCCC"><strong><a href="FileAttribute">Attribute</a>:</strong></th> + </tr> + <tr> + <td><img align="top" height="16" src="%PUBURLPATH%/icn/txt.gif" width="16" /> <a href="%SCRIPTURLPATH%/viewfile%SCRIPTSUFFIX%/TWiki/FileAttachment?rev=&filename=Sample.txt">Sample.txt</a></td> + <td><a href="%SCRIPTURLPATH%/attach%SCRIPTSUFFIX%/TWiki/FileAttachment?filename=Sample.txt&revInfo=1">action</a></td> + <td> 30 </td> + <td> 22 Jul 2000 - 19:37 </td> + <td><a href="PeterThoeny">PeterThoeny</a></td> + <td> Just a sample </td> + <td align="center"> </td> + </tr> + <tr> + <td><img align="top" height="16" src="%PUBURLPATH%/icn/bmp.gif" width="16" /> <a href="%SCRIPTURLPATH%/viewfile%SCRIPTSUFFIX%/TWiki/FileAttachment?rev=&filename=Smile.gif">Smile.gif</a></td> + <td><a href="%SCRIPTURLPATH%/attach%SCRIPTSUFFIX%/TWiki/FileAttachment?filename=Smile.gif&revInfo=1">action</a></td> + <td> 94 </td> + <td> 22 Jul 2000 - 19:38 </td> + <td><a href="PeterThoeny">PeterThoeny</a></td> + <td> Smiley face </td> + <td align="center"> </td> + </tr> + </table> + <p><nop></nop></p> + <h2>Update attachment <code>Sample.txt</code></h2> + <p> + </p> + <table border="1" cellpadding="1" cellspacing="0"> + <tr> + <th align="center" bgcolor="#99CCCC"><strong>Version:</strong></th> + <th align="center" bgcolor="#99CCCC"><strong>Action:</strong></th> + <th align="center" bgcolor="#99CCCC"><strong>Date:</strong></th> + <th align="center" bgcolor="#99CCCC"><strong>Who:</strong></th> + <th align="center" bgcolor="#99CCCC"><strong>Comment:</strong></th> + </tr> + <tr> + <td> 1.1 </td> + <td><a href="%SCRIPTURLPATH%/viewfile%SCRIPTSUFFIX%/TWiki/FileAttachment?rev=1.1&filename=Sample.txt">view</a></td> + <td> 2001.08.30.09.28.56 </td> + <td><a href="PeterThoeny">PeterThoeny</a></td> + <td> </td> + </tr> + </table> + <p> + </p> + <table width="100%"> + <tr> + <td align="right"> Previous <br /> upload: </td> + <td><code>C:\DATA\Sample.txt</code> (<a href="PeterThoeny">PeterThoeny</a>) </td> + </tr> + <tr> + <td align="right"> Local file: </td> + <td><input name="filename" type="hidden" value="Sample.txt" /> <input name="filepath" size="50" type="file" value="C:\DATA\Sample.txt" /></td> + </tr> + <tr> + <td align="right"> Comment: </td> + <td><input maxlength="50" name="filecomment" size="50" type="text" value="Just a sample" /></td> + </tr> + <tr> + <td align="right"> Link: </td> + <td><input name="createlink" type="checkbox" /> Create a link to the attached file at the end of the topic. </td> + </tr> + <tr> + <td align="right"> Hide file: </td> + <td><input name="hidefile" type="checkbox" /> Hide attachment in normal topic view. </td> + </tr> + </table><em>Help text ...</em><p> Topic <b>FileAttachment</b> . { </p><input type="submit" value=" Upload file " /> | <input name="changeproperties" type="submit" value="Change properties" /> | <a href="%SCRIPTURLPATH%/rename%SCRIPTSUFFIX%/TWiki/FileAttachment?attachment=Sample.txt">Move attachment</a> | <a href="FileAttachment">Cancel</a> } </td> + </tr> + </table> +</form> -* Once a file is attached it can be referenced in the topic by <code>%ATTACHURL%/\{filename\}</code> . Example: - * Attach file: `Sample.txt` - * Text is shown as: %PUBURL%/%WEB%/%TOPIC%/Sample.txt , i.e. it is a link. -* GIF and JPG images can be attached and shown in the text like this: - * Attach file: `Smile.gif` - * Edit topic and write text: <code>%ATTACHURL%/Smile.gif</code> - * Text is shown as: %PUBURL%/%WEB%/%TOPIC%/Smile.gif , i.e. it shows up as an image. -* It is not possible to delete attached files with the current TWiki implementation. Contact %WIKIWEBMASTER% if you need to delete files. +The first table is a list of all attachments, including their _attributes_. A `h` means the attachment is hidden i.e. isn't listed when viewing a topic. + +The second table is all the versions of the attachment. Click on `view` to see that version, if it is the most recent version you'll be taken to a URL that always displays the latest version, which is usually what you want to email out. + +If you just want to change the comment on an attachment - enter a new comment and then press _Change properties_. Note that the comment listed against the specific version will not change, however the comment displayed when viewing the topic does change. + +Similarly to hide/unhide an attachment click in the _Hide file_ checkbox are press _Change properties_. + +### <a name="Known_Issues"> Known Issues </a> + +* You can't lock an attachment for editing. However, you may want to change the comment to indicate you are doing that - the comment on the specific version isn't lost, you can see it when listing all the versions of an attachments. |