Extending the list of allowable file types for blogs
Extend the list of possible file types that users could upload to a blog.
About this task
When a file is uploaded to a blog, the mime type specified in the content type in the http request header must match a mime type available for the Java™ Virtual Machine (JVM) so that the correct file extension is applied. By default, the Java™ Virtual Machine (JVM) supports a default set of mime types that map the most common types of content to the correct file extensions. You can extend the list so that users can upload files of types that are not specified in the default list. After you extend the list you must specify that the file type is allowable as an upload. Follow these steps to extend the list and make a new file type allowable for uploads:
Procedure
- Using a text editor, open the file mime.types in
the directory .
The file only includes comments:app_server_root\installedApps\<cell_name>\Blogs.ear\blogs.war\META-INF
# Copyright IBM Corp. 2009 All Rights Reserved. # # comments begin with a '#' # the format is <mime type> <space separated file extensions> # for example: (without the # comment mark) # text/plain txt text TXT # this would map file.txt, file.text, and file.TXT to # the mime type "text/plain"
- Add the mime types you want users to be able to upload.
For example, to support the upload of Microsoft® Excel files, add the mime type application/vnd.ms-excel xls XLS. Blogs would then be able to recognize that file type and assign the XLS file extension.
- Save the file and restart the Blogs server.
- From the Blogs interface, choose the Administration tab.
- On the Configuration page, make sure that Enable File Uploads is enabled.
- Add the new file extension to the Allowed Extensions field.
- Synchronize the changes from the deployment manager to the nodes.