< Back to File Attachments

Introduction to File Attachements

Sometimes you want your users to be able to upload files to your server for display/download. To allow files to be uploaded with topics or posts, make sure you've switched on attachments at Admin Panel -> Settings -> Switches.

At Admin Panel -> Settings -> Files you can set the maximum file size and the file types (extensions) you wish to allow to be uploaded. You may also set the maximum width and height of images when an image is being uploaded, and various other options. At Admin Panel -> Members -> Manage Usergroups you can select which usergroups you wish to allow to upload and download files, as well as how many files per topic/post.

To access attachments, you need to be within the scope of a specific topic. Whenever you are, you can use
[code\<IF {LINKFILEFIELD}>
Attached files:
<!-- BEGIN LINK ATTACHMENTS -->
<a href="{ATTACHDOWNLOADURL">{ATTACHFILETITLE}</a> ({ATTACHKB} KB, {ATTACHDOWNLOADS} downloads)
<!-- END LINK ATTACHMENTS -->
</IF>[/code]
to display them. In WSN 8.0 and older, you'll find something similar to the above in the topic details template. In WSN 9.0 and later, go to Admin -> Topics -> Llsting Fields and edit the Attach Files field, and you'll see it in the custom display html box.

You can limit the number of attachments shown using <!-- BEGIN 1 LINK ATTACHMENTS --> to show just 1.

In cases where the attachments are images, you may wish to automatically display the image. To do this, use
<IF {ATTACHISIMAGE}><img src="{ATTACHDOWNLOADURL}"></IF>
.

To show thumbnails of image attachments, use this:
<IF {ATTACHISIMAGE}><a href="{ATTACHDOWNLOADURL}"><img src="{ATTACHTHUMBURL}"></a> </IF>

You can resize the thumbnail by using {ATTACHTHUMBURL[600 <,> 400]} (this would resize to 600x400).