It appears that you're running an Ad-Blocker. This site is monetized by Advertising and by User Donations; we ask that if you find this site helpful that you whitelist us in your Ad-Blocker, or make a Donation to help aid in operating costs.

Attachments · Wiki


Attachments allow you to upload a file to a post, so long as you have been given permissions to do so and the file type has been allowed. Attachments will appear in a post as an attachment with a link to the file. Image files can be set to display the image itself in lieu of a link. If they meet the criteria set up in the control panel such as file size, etc. There are several steps to make attachments work.

Assign a Directory

The first thing you need to decide is where to place all the uploaded files, I created a directory called uploads then a sub directory called attachments for this feature; this makes it easy to know that all files in uploads need to be included in my backups.
• Create the directory using either a FTP program such as Filezilla. Or using the control panel provided by your web host such as CPanel.
• In this example we will create one called uploads,then a sub directory called attachments.
• So it will appear as uploads/attachments

Set Permissions

Now we need to set file permissions to the new directories to 755 or 777 so they are writeable by the UBB; a rule of thumb in the past with official notations is that directories should be chmodded 777 and files chmodded 666.

Add the Directory to UBB

First, we need to set a URL path and an Absolute path. Enter your Control Panel, if you're not sure what your server path is visit the "Paths and URLs" section of the control panel.

If the "Paths and URLs" link notes that your server path is "/home/user/public_html/forums" then your attachments path would be "/home/user/public_html/uploads/attachments".

Now you'll want to navigate to "Feature Settings" and select the "Attachments" tab.
• The first field "Attachment Storage Directory" is the absolute path so you would enter "/home/user/public_html/uploads/attachments"
• The second field "Full URL to Attachment Storage Directory" is your url to the attachments directory so you would enter "http://www.domain.tld/uploads/attachments"
• The third field "Allowed Attachment File Extensions" is where you add the allowed file type extensions, separated by a comma.
• When finished select the "Update Feature Settings" button.
After you enter the path, select the "Click to Test Directory" link; this will test that the directoy is configured correctly by writing a small file to the directory called "test.file" (some features require this file to exist), if this step fails go back to step two.

Settings for image uploads

• Navigate to "Display Options" -> "General" in the UBB Control Panel.
• Select the Topic Display Options Section to expand it.
• Add a value for "Max Size" for "inline uploaded images".
If an image is attached to a post, if it is smaller than the specified size (in bytes), it will be displayed in the post. This value is entered in bytes so for a 1 MB file you would enter 1048576; if the file is larger than what is entered it will display as a link.

Forum Permissions

Next, you'll need to set permissions on a forum basis so that users can upload files.
• Navigate to "Permissions" -> "Forum Permissions"
• Select the forum you wish to allow uploads in and then select the "Switch" button to change to that forum.

There are several options that you'll need to update:
• "Can Download Attachments" - Enter a 1 for each group type you wish to allow to download.
• "Maximum Size of File Attachments" - Enter a value in bytes that each group type can upload.
• "Total # of File Attachments" - This will limit the number of attachments per post allowed.
This can be a different value per group but can never exceed the maximum value set is step 4. Also no matter what, you can't exceed the value in php.ini which is displayed in this setting.

User Guide

Now, you may be asking, how do I use this feature?
• When you're making a new post or reply, when the forum permissions allow attachments, there will be an option called "File Manager" (using the quick reply will not allow you to attach files). When you click the "File Manager" link you will see a popup window, in the header you will see how many files you may upload as well as the file size limitation.
• "Caption" - if you wish to provide a few words about your upload, you may enter it here.
• "Browse" - When you click this button you will be able to select a file from your system.
• "Add File" - When you click this button, the file you selected above will be uploaded to the server.
• "Attached Files" - Here you will see your uploaded files, and have the option to remove them from your posting.

When you're finished uploading files, select the "Done Adding Files" button and you will be returned to your post, you will see how many files you have attached, but will not see your uploads on this screen. Just like any other post, you'll need to enter a subject and body before you're able to post.
Depending on the settings by the admin for file sizes for inline images, your image will appear displayed within your post. If the size is above the setting size it will display as a link that you can select to open it.

Posted By Gremelin Posted on October 4th, 2014
▼ Sponsored Links ▼
▲ Sponsored Links ▲


( Posted)