**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 [[File Attachment table|Main/WebHome#FileAttachmentTable]].
- Any type of file can be uploaded. Some files that might pose a security risk are renamed, ex: `*.php` files are renamed to `*.php.txt` so that no one can place code that would be read in a .php file.
- 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.
- TWiki can limit the file size. This is defined by the `%ATTACHFILESIZELIMIT%` variable of the [[TWikiPreferences]], currently set at %ATTACHFILESIZELIMIT% KB.
- %X% It's 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.
## Downloading Files
- Click on the file in the [[File Attachment table|Main/WebHome#FileAttachmentTable]].
- %X% _NOTE:_ 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 [[access restrictions|Main/TWikiDocumentation#TWikiAccessControl]] for each.
## Moving Attachment Files
An attachment can be moved between topics.
- Click **Manage**
on the Attachment to be moved.
- On the control screen, select the new web and/or topic.
- Click **Move**
. The attachment and its version history are moved. The original location is stored as [[topic Meta Data|Main/TWikiDocumentation#Meta_Data_Definition]].
## Deleting Attachments
Move unwanted Attachments to web `Trash`, topic `TrashAttachment`.
## Linking to Attached Files
- Once a file is attached it can be referenced in the topic. Example:
1. **Attach**
file: `Sample.txt`
2. **Edit**
topic and enter: `%ATTACHURL%/Sample.txt`
3. **Preview**
: `%ATTACHURL%/Sample.txt` text appears as: **Attach**
file: `Sample.txt`
2. **Edit**
topic and write text: `%INCLUDE{"%ATTACHURL%/Sample.txt"}%`
- 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:
1. **Attach**
file: `Smile.gif`
2. **Edit**
topic and write text: `%ATTACHURL%/Smile.gif`
3. **Preview**
: text appears as ![Smile.gif](http://www.dementia.org/twiki//view/%WEB%/%TOPIC%/Smile.gif), an image.
## File Attachment Contents Table
Files attached to a topic are displayed in a directory table, displayed at the bottom of the page, or optionally, hidden and accessed when you click **Attach**.
>
>
|
>
**Manage**
link takes you to a new page that looks like this:
>
- The first table is a list of all attachments, including their attributes. An `h` means the attachment is hidden, it 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's the most recent version, you'll be taken to an URL that always displays the latest version, which is usually what you want.
- **To change the comment** on an attachment, enter a new comment and then click **Change properties**. Note that the comment listed against the specific version will not change, however the comment displayed when viewing the topic does change.
- **To hide/unhide** an attachment, enable the **Hide file**
checkbox, then click **Change properties**
.
## Known Issues
- 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.