Hi,
When a file without supported filetype is attached to a ticket, the view
attachment will fail.
The following patch solves that problem and adds support for displaying a
.wiki attachment as wiki.

/Philip


Index: trac/attachment.py
===================================================================
--- trac/attachment.py  (revision 3483)
+++ trac/attachment.py  (working copy)
@@ -434,6 +434,13 @@
             binary = is_binary(str_data)
             mime_type = mimeview.get_mimetype(attachment.filename, str_data)

+            # PHILIP BERGEN ([EMAIL PROTECTED])
+            # For unsupported types
+            if not mime_type:
+                mime_type='text/plain'
+                if attachment.filename.endswith('.wiki'):
+                    mime_type='text/x-trac-wiki'
+
             # Eventually send the file directly
             format = req.args.get('format')
             if format in ('raw', 'txt'):

_______________________________________________
Trac-dev mailing list
[email protected]
http://lists.edgewall.com/mailman/listinfo/trac-dev

Reply via email to