Setting limits on uploaded files 

Edit configuration property settings to limit the types of files that can be uploaded into Activities, the maximum size of an uploaded file, and the number of server threads concurrently dedicated to downloading files from Activities to clients.


Before starting

To edit configuration files, use the wsadmin client. See Starting the wsadmin client for details.


About this task

The Activities content store is used to store files that users upload to their activities.

To set limits on uploaded files, complete the following steps


Procedure

  1. Use the wsadmin client to access and check out the Activities configuration files.

    1. Access the Activities configuration file:

        execfile("activitiesAdmin.py")

        If prompted to specify a service to connect to, type 1 to pick the first node in the list. Most commands can run on any node. If the command writes or reads information to or from a file using a local file path, pick the node where the file is stored.

    2. Check out the Activities configuration files using the following command:

        ActivitiesConfigService.checkOutConfig("<working_directory>","<cell_name>")

        where:

        • <working_directory> is the temporary working directory to which the configuration XML and XSD files are copied and are stored while you make changes to them. Use forward slashes to separate directories in the file path, even if you are using the Microsoft™ Windows™ operating system.

            Note: AIX and Linux™ only: The directory must grant write permissions or the command will not run successfully.

        • <cell_name> is the name of the WAS cell hosting the IBM Connections application. This argument is 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:

            print AdminControl.getCell()

        For example:

        • AIX/Linux:

            ActivitiesConfigService.checkOutConfig("/opt/act/temp","foo01Cell01")

        • Microsoft Windows:

            ActivitiesConfigService.checkOutConfig("c:/act/temp","foo01Cell01")

  2. From the temporary directory to which you just checked out the oa-config.xml file, open the file in a text editor.

  3. Edit the elements in the <objectStore> section of the file to set limits on the files that can be uploaded.

    • To prevent users from being able to upload files of a specific type to Activities, add a <sizeLimits> element block to the <objectStore> section. For each file type that you want to disable, create a <limit> element. Set the mimeFilenameRegex attribute of the <limit> element equal to the file extension of the file type that you want to prevent users from uploading. Set the value of the limit element to 0. For example, the following element prevents users from being able to upload executable files:

        <sizeLimits>
           <limit mimeFilenameRegex=".*\.exe">0</limit>
        </sizeLimits>

        Tip: When you specify a value for the mimeFilenameRegex attribute, you are specifying a regular expression. Regular expressions are normally case sensitive, and in the 1.0.x releases were treated as such. With release 2.0, the filter has been enhanced to be case insensitive. For example, if you specify <limit mimeFilenameRegex=".*\.exe">, the tool will filter any files with a .exe extension regardless of the case in which the letters EXE are specified.

    • To limit the size of all files uploaded to the Activities content store, modify the value of the <limit> element for the entry with the .* extension. Specify the new maximum size value in bytes. For example, the following property settings specifies that all files must be smaller than 10.5 MB:

        <limit mimeFilenameRegex=".*">10500000</limit>

    • To limit the number of threads that are allowed to concurrently respond to requests to download files from the Activities content store, edit the value of the <max-concurrent-downloads> element. For example, the following property settings allows the server to permit a maximum of 10 downloads at one time:

        <max-concurrent-downloads>10</max-concurrent-downloads>

  4. To remove a file upload limitation, delete the <limit> element representing the file type that you want to permit users to upload.

  5. To enable unlimited simultaneous downloads, remove the <max-concurrent-downloads> element.

  6. Save and close the oa-config.xml file.

  7. After making changes, check the configuration files back in and do so during the same wsadmin session in which you checked them out for the changes to take effect. You must also restart the server. See Apply property changes for details.

  8. After restarting the Activities server, review the WAS SystemOut.log file to ensure that the Activities application was able to initialize with the modified configuration.

Example

The following lines of XML provides an example of oa-config.xml file content that describes a <sizelimit> configuration. In this example, files with .exe, .sh, .bat, and .oa extentions cannot be uploaded to Activities, the maximum file size of an uploaded file is approximately 10MB, and the number of concurrent downloads is limited to 5.

<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>


Parent topic

Manage uploaded files


Related tasks


Checking out the Activities configuration files
Apply property changes in Activities


   

 

});

+

Search Tips   |   Advanced Search