Setting limits on uploaded Forums files
Edit your Forums configuration settings to limit the types of files that can be uploaded to Forums.
Before you begin
To edit configuration files, you must use the wsadmin client. See Starting the wsadmin client for details.
About this task
The Forums content store is used to store files that users upload to their forums. By editing the forum-config.xml Forums configuration file, you can set the maximum size of an uploaded file, configure allowed file types, and restrict certain file types. You can also specify the number of server threads that are concurrently dedicated to downloading files from Forums to clients.
- Use the wsadmin client to check out the forum-config.xml file.
- Use the following command
to access the Forums configuration file:
If you are prompted to specify a service to connect to, enter 1 to select the first node in the list. Most commands can run on any node. If the command specifies a file by using a local file path, select the node where the file is stored.
- Check out the Forums configuration
files by using the following command:
- working_directory is the temporary working directory to which the XML and XSD
configuration files are copied. The files are kept in this working directory while you modify
them.Note: AIX® and Linux only: The directory must grant write permissions or the command fails.
- cell_name is the name of the WebSphere® Application Server cell that
hosts the IBM® Connections applications.
This argument is required. It is also case-sensitive, so type it with
care. If you do not know the cell name, you can determine it by typing
the following command in the wsadmin command processor:
- working_directory is the temporary working directory to which the XML and XSD configuration files are copied. The files are kept in this working directory while you modify them.
- Use the following command to access the Forums configuration file:
- Open the forum-config.xml file in a text editor.
- Edit the elements in the <objectStore> section of the
- To prevent users from uploading files of a specific type to Forums,
complete the following steps:
- Add a <sizeLimits> element to the <objectStore> section.
- For each file type that you want to disable, create a <limit> element.
- In the mimeFilenameRegex attribute of this element, specify the file extension of the file type that you want to disable.
- Set the value of the limit element to 0.
For example, the following element prevents users from uploading executable files:
<sizeLimits> <limit mimeFilenameRegex=".*\.exe">0</limit> </sizeLimits>Tip: To remove an upload limitation, delete the <limit> element for the file type that you want to allow.
- To limit the size of uploaded files, modify the value of the <limit>
element with the .* extension. Specify the
new maximum size value in bytes.
For example, the following property setting specifies that uploaded files must be smaller than 10.5 MB:
- To limit the number of concurrent server threads, edit the value
For example, the following setting allows a maximum of 10 simultaneous downloads:
<max-concurrent-downloads>10</max-concurrent-downloads>Tip: To enable unlimited simultaneous downloads, remove the <max-concurrent-downloads> element.
- To prevent users from uploading files of a specific type to Forums, complete the following steps:
- Save and close the forum-config.xml file.
- Check in the configuration file. Note: For your changes to take effect, you must check in the file during the same wsadmin session in which you checked it out.
- Restart the server that hosts the Forums application. For more information, see Applying property changes in Forums.
- After you restart the Forums server, review the WebSphere Application Server SystemOut.log file to ensure that the Forums application was initialized with the modified configuration.
<sizeLimits> <limit mimeFilenameRegex=".*\.exe">0</limit> <limit mimeFilenameRegex=".*\.bat">0</limit> <limit mimeFilenameRegex=".*\.sh">0</limit> <limit mimeFilenameRegex=".*\.oa">0</limit> <limit mimeFilenameRegex=".*">10485760</limit> </sizeLimits> <max-concurrent-downloads>5</max-concurrent-downloads>