Changes between Version 1 and Version 2 of AttachFilterPlugin


Ignore:
Timestamp:
May 16, 2011, 4:02:41 PM (13 years ago)
Author:
anonymous
Comment:

Initial documentation

Legend:

Unmodified
Added
Removed
Modified
  • AttachFilterPlugin

    v1 v2  
    2424You can check out AttachFilterPlugin from [http://trac-hacks.org/svn/attachfilterplugin here] using Subversion, or [source:attachfilterplugin browse the source] with Trac.
    2525
    26 == Example ==
     26== Documentation ==
    2727
    28 TBD
     28In `trac.ini`, add a new section `[attachment_filter]`, where:
     29 * keys match the mime file type to exclude
     30 * values gives a brief description that is shown to the user to explain why the file is rejected
     31
     32=== Example ===
     33
     34{{{
     35#!ini
     36[attachment_filter]
     37application/vnd.ms-excel = Microsoft Excel documents should be attached as PDF files
     38application/vnd.ms-powerpoint = Microsoft PowerPoint documents should be attached as PDF files
     39application/msword = Microsoft Word documents should be attached as PDF files
     40image/bmp = Microsoft bitmap images should be attached as PNG images
     41}}}
     42
     43Yep, M$ is evil :-)
     44
     45=== MIME type ===
     46
     47To obtain the exact MIME type string:
     48 1. set up your Trac installation to show/dump INFO log message,
     49 1. attach a file of the (un)desired type
     50 1. look for the plugin trace that shows the file name and the MIME type:
     51{{{
     52grep Filename .../log/trac.log
     53}}}
     54{{{
     552011-05-16 15:49:26,299 Trac[filter] INFO: Filename stuff.doc, filetype application/msword
     56}}}
     57 1. add this new MIME type to the `[attachment_filter]` section
     58 1. restart your Trac engine
    2959
    3060== Recent Changes ==