[or-cvs] r21268: {projects} Give the attachment we send out a nice name (projects/gettor/lib/gettor)

kaner at seul.org kaner at seul.org
Fri Dec 18 22:34:49 UTC 2009


Author: kaner
Date: 2009-12-18 17:34:48 -0500 (Fri, 18 Dec 2009)
New Revision: 21268

Modified:
   projects/gettor/lib/gettor/responses.py
Log:
Give the attachment we send out a nice name


Modified: projects/gettor/lib/gettor/responses.py
===================================================================
--- projects/gettor/lib/gettor/responses.py	2009-12-18 22:25:28 UTC (rev 21267)
+++ projects/gettor/lib/gettor/responses.py	2009-12-18 22:34:48 UTC (rev 21268)
@@ -222,12 +222,13 @@
 
         # Add a file if we have one
         if fileName:
-            filePart = MIMEBase("application", "octet-stream")
+            filePart = MIMEBase("application", "zip")
             fp = open(fileName, 'rb')
             filePart.set_payload(fp.read())
             fp.close()
             encoders.encode_base64(filePart)
             # Add file part
+            filePart.add_header('Content-Disposition', 'attachment', filename=os .path.basename(fileName))
             message.attach(filePart)
 
         return message



More information about the tor-commits mailing list