changeset 1102:8d0858376163 beta

fixed problem with rawfile content_disposition attachment, webob assumes that file is encoded with iso, and we use utf8 in rhodecode
author Marcin Kuzminski <marcin@python-works.com>
date Sun, 27 Feb 2011 03:24:04 +0100
parents c1080b42a7cb
children 918c0b600a06
files rhodecode/controllers/files.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/rhodecode/controllers/files.py	Sun Feb 27 03:18:23 2011 +0100
+++ b/rhodecode/controllers/files.py	Sun Feb 27 03:24:04 2011 +0100
@@ -136,9 +136,9 @@
             h.flash(str(e), category='warning')
             redirect(h.url('files_home', repo_name=repo_name, revision=cs.raw_id))
 
+        fname = f_path.split('/')[-1].encode('utf8', 'replace')
         response.content_type = file_node.mimetype
-        response.content_disposition = 'attachment; filename=%s' \
-                                                    % f_path.split('/')[-1]
+        response.content_disposition = 'attachment; filename=%s' % fname
         return file_node.content
 
     def raw(self, repo_name, revision, f_path):