Index: attachment.py
===================================================================
--- attachment.py	(revision 2070)
+++ attachment.py	(working copy)
@@ -461,12 +461,18 @@
                     parent_type = path_info[1]
                 if len(path_info) > 2:
                     parent_id = path_info[2]
-            filename = link
+            idx = link.find('?')
+            if idx < 0:
+                filename = link
+                params = ''
+            else:
+                filename = link[0:idx]
+                params = link[idx:]
         try:
             attachment = Attachment(self.env, parent_type, parent_id, filename)
             return '<a class="attachment" title="%s" href="%s">%s</a>' \
                    % ('Attachment ' + attachment.title,
-                      attachment.href(), label)
+                      attachment.href() + params, label)
         except TracError:
             return '<a class="missing attachment" href="%s" rel="nofollow">%s</a>' \
                    % (self.env.href.wiki(), label)

