for archive members, force attachment download mode, so it uses the member filename, fixes #306
authorThomas Waldmann <tw AT waldmann-edv DOT de>
Mon, 24 Dec 2012 00:10:20 +0100
changeset 18982b4bcb80d644
parent 1897 df3e72208eed
child 1899 f38a893334b5
for archive members, force attachment download mode, so it uses the member filename, fixes #306
MoinMoin/items/content.py
     1.1 --- a/MoinMoin/items/content.py	Sun Dec 23 23:23:19 2012 +0100
     1.2 +++ b/MoinMoin/items/content.py	Mon Dec 24 00:10:20 2012 +0100
     1.3 @@ -358,6 +358,9 @@
     1.4              mt = MimeType(filename=filename)
     1.5              content_length = None
     1.6              file_to_send = self.get_member(member)
     1.7 +            # force attachment download, so it uses attachment_filename
     1.8 +            # otherwise it will use the itemname from the URL for saving
     1.9 +            force_attachment = True
    1.10          else: # content = item revision
    1.11              rev = self.rev
    1.12              filename = rev.item.name