Defect #7288

Non ASCII filename downloaded from repo is broken on Internet Explorer.

Added by Kesarr B almost 7 years ago. Updated almost 7 years ago.

Status:ClosedStart date:2011-01-11
Priority:NormalDue date:
Assignee:Toshi MARUYAMA% Done:

0%

Category:SCM
Target version:1.1.2
Resolution:Fixed Affected version:1.1.1

Description

On Internet Explorer, a filename downloded from repository is broken, because that filename is consist of multibyte characters. But, that is absolutely normal on Chrome.
In addition, attached files in the Redmine "files" page have no problem.

I think that this code has no problem,

./controllers/attachments_controller.rb:
    send_file @attachment.diskfile, :filename => filename_for_content_disposition(@attachment.filename),

... and this code has a problem.

./controllers/repositories_controller.rb:
    send_data @content, :filename => @path.split('/').last

I test that modification like below, and it seems successful!

    send_data @content, :filename => filename_for_content_disposition(@path.split('/').last)

In my opinion, some of other

send_data
s can have similar problems.

redmine_repository_download_original.png - (WRONG) send_data @content, :filename => @path.split('/').last (48.6 KB) Kesarr B, 2011-01-11 12:34

redmine_repository_download_modified.png - (RIGHT) send_data @content, :filename => filename_for_content_disposition(@path.split('/').last) (49.1 KB) Kesarr B, 2011-01-11 12:34

ie-before.png (39.3 KB) Toshi MARUYAMA, 2011-02-12 13:16

ie-after.png (36.5 KB) Toshi MARUYAMA, 2011-02-12 13:16

Associated revisions

Revision 4816
Added by Toshi MARUYAMA almost 7 years ago

scm: fix non ASCII filename downloaded from repo is broken on Internet Explorer (#7288).

History

#1 Updated by Toshi MARUYAMA almost 7 years ago

  • Category set to SCM

What SCM do you use?

#2 Updated by Kesarr B almost 7 years ago

Toshi MARUYAMA wrote:

What SCM do you use?

I use Subversion as SCM.

#3 Updated by Toshi MARUYAMA almost 7 years ago

Subversion stored paths as Unicode.
Can you paste a path and attach a image?

#5 Updated by Toshi MARUYAMA almost 7 years ago

  • Subject changed from Non-ISO-8859-1 filename downloaded from repo is broken on Internet Explorer. to Non ASCII filename downloaded from repo is broken on Internet Explorer.

Thanks. Is it Korean named file?

#6 Updated by Kesarr B almost 7 years ago

Toshi MARUYAMA wrote:

Thanks. Is it Korean named file?

Yes, it is. And both WRONG and RIGHT have the exactly same url.

#7 Updated by Toshi MARUYAMA almost 7 years ago

  • Assignee set to Toshi MARUYAMA

#8 Updated by Toshi MARUYAMA almost 7 years ago

  • Target version set to 1.1.2
  • Affected version (unused) set to 1.1.1
  • Affected version set to 1.1.1

#9 Updated by Toshi MARUYAMA almost 7 years ago

I commited trunk r4816 and 1.1 r4819.

These are images on my Japanese Windows Vista and IE 8.

"send_data" at source:trunk/app/controllers/repositories_controller.rb@4817#L164 is revision and it is ASCII.

Also available in: Atom PDF