Changeset - 8d0858376163
[Not reviewed]
beta
0 1 0
Marcin Kuzminski - 15 years ago 2011-02-27 03:24:04
marcin@python-works.com
fixed problem with rawfile content_disposition attachment,
webob assumes that file is encoded with iso, and we use utf8 in rhodecode
1 file changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
rhodecode/controllers/files.py
Show inline comments
 
@@ -133,15 +133,15 @@ class FilesController(BaseRepoController
 
        try:
 
            file_node = cs.get_node(f_path)
 
        except RepositoryError, e:
 
            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):
 
        cs = self.__get_cs(revision, repo_name)
 
        try:
 
            file_node = cs.get_node(f_path)
0 comments (0 inline, 0 general)