Latest Register Log In

+ Advanced Search

Introduction to File Attachements

Introduction to File Attachements
By
10/24/03 (Edited 03/11/14)

Sometimes you want your users to be able to upload files to your server for display/download. To allow files to be uploaded with articles or comments, 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 article/comment.

To access attachments, you need to be within the scope of a specific article. 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 article details template. In WSN 9.0 and later, go to Admin -> Articles -> 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).




Description Instructions on controlling file attachments.
Rating
Views 1686 views. Averaging 0 views per day.