~kosova/+junk/tuxfamily-twiki

« back to all changes in this revision

Viewing changes to foswiki/data/System/FileAttachment.txt

  • Committer: James Michael DuPont
  • Date: 2009-07-18 19:58:49 UTC
  • Revision ID: jamesmikedupont@gmail.com-20090718195849-vgbmaht2ys791uo2
added foswiki

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
%META:TOPICINFO{author="ProjectContributor" date="1231502400" format="1.1" version="1"}%
 
2
%STARTINCLUDE%
 
3
---+ File Attachments
 
4
 
 
5
_Each topic can have one or more files of any type attached to it by using the Attach screen to upload (or download) files from your local PC. Attachments are stored under revision control: uploads are automatically backed up; all previous versions of a modified file can be retrieved._ 
 
6
 
 
7
%TOC%
 
8
 
 
9
%STARTSECTION{"UserGuide"}%
 
10
---++ What are attachments good for?
 
11
 
 
12
File Attachments can be used to archive data, or to create powerful customized groupware solutions, like file sharing and document management systems, and quick Web page authoring.
 
13
 
 
14
---+++ Document management system
 
15
 
 
16
You can use Attachments to store and retrieve documents (in any format, with associated graphics, and other media files); attach documents to topics; collaborate on documents with full revision control; distribute documents on a [[#AttachmentAccess][need-to-know basis]] using web and topic-level access control; create a central reference library that's easy to share with an user group spread around the world.
 
17
 
 
18
---+++ File sharing
 
19
 
 
20
For file sharing, FileAttachments on a series of topics can be used to quickly create a well-documented, categorized digital download center for all types of files: documents, graphics and other media, drivers and patches, applications; anything you can safely upload!
 
21
 
 
22
---+++ Web authoring
 
23
 
 
24
Through your web browser, you can easily upload graphics (or sound files, or anything else you want to link to on a page) and place them on a single page, or use them across a web, or site-wide.
 
25
 
 
26
%H% You can also add graphics - any files - directly, typically by FTP upload. This requires FTP access, and may be more convenient if you have a large number of files to load. FTP-ed files cannot be managed using browser-based attachment controls. You can use your browser to create shortcuts using [[Macros]], like this %<nop>H% = %H%.
 
27
 
 
28
---++ Uploading files
 
29
 
 
30
   * Click on the ==[Attach]== link at the bottom of the page. The =Attach= screen lets you browse for a file, add a comment, and upload it. The uploaded file will show up in the [[#FileAttachmentTable][file attachment table]].
 
31
      * %H% The topic must already exist. If it does not, it is a two step process: First create the topic, then add the file attachment.
 
32
      * Any type of file can be uploaded. Some files that might pose a security risk are renamed, for example: =*.php= files are renamed to =*.php.txt= so that no one can place code that would be read in a .php file.
 
33
      * Foswiki can limit the file size. This is defined by the =%<nop>ATTACHFILESIZELIMIT%= [[%SYSTEMWEB%.PreferenceSettings][preference settings]], currently set at %ATTACHFILESIZELIMIT% kB.
 
34
         * %X% It is not recommended to upload files greater than a few hundred K through a browser. Large files can be extremely slow-loading, and often time out. Use an FTP site for large file uploads.
 
35
   * Automatic attachments:
 
36
      * When enabled, all files in a topic's attachment directory are shown as attachments to the topic - even if they were directly copied to the directory and never attached by using an =[Attach]= link. This is a convenient way to quickly "attach" files to a topic without uploading them one by one; although at the cost of losing audit trail and version control.
 
37
      * To enable this feature, set the {AutoAttachPubFiles} configuration option.
 
38
      * %H% The automatic attachment feature can only be used by an administrator who has access to the server's file system.
 
39
   
 
40
---++ Downloading files
 
41
 
 
42
   * Click on the file in the [[#FileAttachmentTable][File Attachment table]].
 
43
#AttachmentAccess
 
44
 
 
45
   * %X% There is no access control on individual attachments. If you need control over single files, create a separate topic per file and set topic-level [[CompleteDocumentation#AccessControl][access restrictions]] for each.
 
46
 
 
47
---++ Moving attachment files
 
48
 
 
49
An attachment can be moved between topics. 
 
50
   * Click ==[Manage]== on the Attachment to be moved.
 
51
   * On the control screen, select the new web and/or topic.
 
52
   * Click ==[Move]==. The attachment and its version history are moved. The original location is stored as [[CompleteDocumentation#Meta_Data_Definition][topic meta data]].
 
53
 
 
54
---++ Deleting attachments
 
55
 
 
56
Move unwanted Attachments to web =Trash=, topic =TrashAttachment=.
 
57
 
 
58
---++ Linking to attached files
 
59
 
 
60
   * Once a file is attached it can be referenced in the topic. Example:
 
61
      1. ==[Attach]== a file, for example: =Sample.txt=
 
62
      1. ==[Edit]== the topic you attached the file to and enter: =%<nop>ATTACHURL%/Sample.txt=
 
63
      1. ==[Preview]==: the =%<nop>ATTACHURL%/Sample.txt= text appears as: %PUBURLPATH%/%WEB%/%TOPIC%/Sample.txt, a link to the text file.
 
64
 
 
65
   * To reference an attachment located in another topic, enter:
 
66
      * =%<nop>PUBURLPATH%/%<nop>WEB%/OtherTopic/Sample.txt= (if it's within the same web)
 
67
      * =%<nop>PUBURLPATH%/Otherweb/OtherTopic/Sample.txt= (if it's in a different web)
 
68
 
 
69
   * Attached HTML files and text files can be inlined in a topic. Example:
 
70
      1. ==[Attach]== file: =Sample.txt=
 
71
      1. ==[Edit]== topic and write text: =%<nop>INCLUDE{"%<nop>ATTACHURL%/Sample.txt"}%=
 
72
         * Content of attached file is shown inlined.
 
73
         * [[VarINCLUDE][Read more about INCLUDE]].
 
74
 
 
75
   * GIF, JPG and PNG images can be attached and shown embedded in a topic. Example:
 
76
      1. ==[Attach]== an image file, for example: =Smile.gif=
 
77
      1. ==[Edit]== topic and write text: =%<nop>ATTACHURL%/Smile.gif=
 
78
      1. ==[Preview]==: text appears as %ATTACHURL%/Smile.gif, an image.
 
79
 
 
80
---++ Examples
 
81
Following you will find some examples of screens and tables related to this topic and referenced throughout the previous text. The appearance of these tables might vary, depending on what [[Skins][skin]] is used on your Foswiki installation.
 
82
 
 
83
#FileAttachmentTable
 
84
---+++ File attachment table
 
85
 
 
86
Files attached to a topic are displayed in a directory table, showing the different file names and attributes. An =h= means the attachment is hidden and not listed when viewing a topic in normal mode. 
 
87
 
 
88
The file attachment table is normally displayed at the bottom of the page, or optionally, hidden and accessed when you click =[Attach]=.
 
89
 
 
90
<div class="foswikiAttachments">
 
91
<table summary="Topic attachments" style="border-width:1px;" cellspacing="0" id="foswikiAttachmentsTable" cellpadding="0" class="foswikiTable" rules="rows" border="1"><caption>Topic attachments</caption><tr class="foswikiTableEven"><th bgcolor="#ffffff" align="center" valign="middle" style="text-align:center;vertical-align:middle;" class="foswikiFirstCol"> <a rel="nofollow" href="#FileAttachmentTable" style="color:#0066cc" title="Sort by this column">I</a> </th><th bgcolor="#ffffff" align="center" valign="middle" style="text-align:center;vertical-align:middle;"> <a rel="nofollow" href="#FileAttachmentTable" style="color:#0066cc" title="Sort by this column">Attachment</a> </th><th bgcolor="#ffffff" align="center" valign="middle" style="text-align:center;vertical-align:middle;"> <a rel="nofollow" href="#FileAttachmentTable" style="color:#0066cc" title="Sort by this column">Action</a> </th><th bgcolor="#ffffff" align="center" valign="middle" style="text-align:center;vertical-align:middle;"> <a rel="nofollow" href="#FileAttachmentTable" style="color:#0066cc" title="Sort by this column">Size</a> </th><th bgcolor="#ffffff" align="center" valign="middle" style="text-align:center;vertical-align:middle;"> <a rel="nofollow" href="#FileAttachmentTable" style="color:#0066cc" title="Sort by this column">Date</a> </th><th bgcolor="#ffffff" align="center" valign="middle" style="text-align:center;vertical-align:middle;"> <a rel="nofollow" href="#FileAttachmentTable" style="color:#0066cc" title="Sort by this column">Who</a> </th><th bgcolor="#ffffff" align="center" valign="middle" style="text-align:center;vertical-align:middle;"> <a rel="nofollow" href="#FileAttachmentTable" style="color:#0066cc" title="Sort by this column">Comment</a> </th></tr>
 
92
<tr class="foswikiTableOdd"><td bgcolor="#ffffff" align="center" valign="top" style="text-align:center;vertical-align:top;" class="foswikiFirstCol"> <img width="16" alt="txt" align="top" src="%PUBURL%/%SYSTEMWEB%/DocumentGraphics/txt.gif" height="16" border="0" /><span class="foswikiHidden">txt</span> </td><td bgcolor="#ffffff" align="left" valign="top" style="text-align:left;vertical-align:top;"> <a href="#FileAttachmentTable">Sample.txt</a> </td><td bgcolor="#ffffff" align="left" valign="top" style="text-align:left;vertical-align:top;"> <a href="#FileAttachmentTable" title='change, update, previous revisions, move, delete...'rel='nofollow'>manage</a> </td><td bgcolor="#ffffff" align="right" valign="top" style="text-align:right;vertical-align:top;"> 0.1&nbsp;K </td><td bgcolor="#ffffff" align="left" valign="top" style="text-align:left;vertical-align:top;"> 22 Jul 2000 - 19:37 </td><td bgcolor="#ffffff" align="left" valign="top" style="text-align:left;vertical-align:top;"> <a href="#FileAttachmentTable">ProjectContributor</a> </td><td bgcolor="#ffffff" align="left" valign="top" style="text-align:left;vertical-align:top;"> Just a sample </td></tr>
 
93
<tr class="foswikiTableEven"><td bgcolor="#ffffff" align="center" valign="top" style="text-align:center;vertical-align:top;" class="foswikiFirstCol foswikiLast"> <img width="16" alt="gif" align="top" src="%PUBURL%/%SYSTEMWEB%/DocumentGraphics/gif.gif" height="16" border="0" /><span class="foswikiHidden">gif</span> </td><td bgcolor="#ffffff" align="left" valign="top" style="text-align:left;vertical-align:top;" class="foswikiLast"> <a href="#FileAttachmentTable">Smile.gif</a> </td><td bgcolor="#ffffff" align="left" valign="top" style="text-align:left;vertical-align:top;" class="foswikiLast"> <a href="#FileAttachmentTable" title='change, update, previous revisions, move, delete...'rel='nofollow'>manage</a> </td><td bgcolor="#ffffff" align="right" valign="top" style="text-align:right;vertical-align:top;" class="foswikiLast"> 0.1&nbsp;K </td><td bgcolor="#ffffff" align="left" valign="top" style="text-align:left;vertical-align:top;" class="foswikiLast"> 22 Jul 2000 - 19:38 </td><td bgcolor="#ffffff" align="left" valign="top" style="text-align:left;vertical-align:top;" class="foswikiLast"> <a href="#FileAttachmentTable">ProjectContributor</a> </td><td bgcolor="#ffffff" align="left" valign="top" style="text-align:left;vertical-align:top;" class="foswikiLast"> Smiley face </td></tr>
 
94
</table></div><!--//foswikiAttachments-->
 
95
 
 
96
#FileAttachmentControls
 
97
---+++ File attachment controls
 
98
 
 
99
Clicking on a ==[Manage]== link takes you to a new page that looks a bit like this (depending on what [[Skins][skin]] is selected). 
 
100
 
 
101
Here, you have different options:
 
102
   * *To update an existing file*, choose the updated file on your local drive and click ==[Update file]==. The filename of the original attachment will preserved; the filename of the local file you chose will *not* be used.
 
103
   * *To change the comment* on an attachment, enter a new comment and then click ==[Change comment and properties only]==.  Note that the comment listed against the specific version will not change, however the comment displayed when viewing the topic does change.  
 
104
   * *To hide/unhide* an attachment, enable the ==Do not show attachment in table== checkbox, then click ==[Change comment and properties only]==.
 
105
 
 
106
<div class="foswikiFormSteps">
 
107
<div class="foswikiFormStep">
 
108
<h3><a name="Attach_new_file"></a> Attach new file </h3>
 
109
<p />
 
110
Select a new local file to update attachment <code>Sample.txt</code> <br />Upload up to 10000 KB.
 
111
<p />
 
112
<input class="foswikiInputField" type="file" name="filepath" value="Sample.txt" size="30" /><input type="hidden" name="filename" value="Sample.txt" />
 
113
</div><!-- /foswikiFormStep-->
 
114
<div class="foswikiFormStep">
 
115
<h3><a name="Comment"></a> Comment </h3>
 
116
<p />
 
117
Describe the file so other people know what it is.
 
118
<p />
 
119
<input class="foswikiInputField" type="text" name="filecomment" value="Just a sample" maxlength="256" size="50" />
 
120
</div><!-- /foswikiFormStep-->
 
121
<div class="foswikiFormStep">
 
122
<h3><a name="Properties"></a> Properties </h3>
 
123
<p />
 
124
<input type="checkbox" class="foswikiCheckbox" id="createlink" name="createlink"  /><label for="createlink">Create a link to the attached file</label> <span class="foswikiGrayText">Images will be displayed, for other attachments a link will be created.</span>
 
125
<p />
 
126
<input type="checkbox" class="foswikiCheckbox" id="hidefile" name="hidefile"  /><label for="hidefile">Do not show attachment in table</label> <span class="foswikiGrayText">Attachments will not be shown in topic view page.</span>
 
127
</div><!-- /foswikiFormStep--><div class="foswikiFormStep foswikiLast"><input type="submit" class="foswikiButton" name="changeproperties" value='Change comment and properties only' /></div><!-- /foswikiFormStep-->
 
128
</div><!-- /foswikiFormSteps-->
 
129
<a name="topic-actions"> </a><div class="patternTopicActions"><div class="patternTopicAction" style="margin-top:-1px;"><span class="patternActionButtons"> <input type="submit" class="foswikiSubmit" value='Upload file' /> or <a href="#FileAttachmentControls" title='Back to topic' accesskey='c' rel='nofollow'><span class='foswikiAccessKey'>C</span>ancel</a></span></div></div><!--/patternTopicActions-->
 
130
 
 
131
 
 
132
---++ Known Issues
 
133
 
 
134
   * Unlike topics, attachments are not locked during editing. As a workaround, you can change the comment to indicate an attachment file is being worked on - the comment on the specific version isn't lost, it's there when you list all versions of the attachment.
 
135
   * Attachments are not secured. Anyone can read them if they know the name of the web, topic and attachment.
 
136
 
 
137
%ENDSECTION{"UserGuide"}%
 
138
%STOPINCLUDE%
 
139
 
 
140
---
 
141
*Related Topics:* UserDocumentationCategory
 
142
 
 
143
%META:FILEATTACHMENT{name="Sample.txt" attr="" comment="Just a sample" date="964294620" path="Sample.txt" size="30" user="ProjectContributor" version=""}%
 
144
%META:FILEATTACHMENT{name="Smile.gif" attr="" comment="Smiley face" date="964294680" path="Smile.gif" size="94" user="ProjectContributor" version=""}%