Project

General

Profile

Actions

Defect #1089

closed

attachement's name maybe invalid.

Added by 延平 贾 over 16 years ago. Updated over 16 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Attachments
Target version:
Start date:
2008-04-23
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

OS: windows
Lang: Chinese
When I uploaded a file with Chinese name, the file saved in Redmine/files directory has a unreadable name, and with some special word, it will failed.
I have a patch to avoid the failing,but the file name in Redmine/files will unreadable.

Index: D:/RedMine/app/models/attachment.rb
===================================================================
--- D:/RedMine/app/models/attachment.rb    (revision 1339)
+++ D:/RedMine/app/models/attachment.rb    (working copy)
@@ -40,7 +40,7 @@
       @temp_file = incoming_file
       if @temp_file.size > 0
         self.filename = sanitize_filename(@temp_file.original_filename)
-        self.disk_filename = DateTime.now.strftime("%y%m%d%H%M%S") + "_" + self.filename
+        self.disk_filename = DateTime.now.strftime("%y%m%d%H%M%S") + "_" + Digest::MD5.hexdigest(self.filename)
         self.content_type = @temp_file.content_type.to_s.chomp
         self.filesize = @temp_file.size
       end


Related issues

Has duplicate Redmine - Defect #1243: Uploading of attachment with Non-ascii filename fails when host on windowsClosed2008-05-15

Actions
Has duplicate Redmine - Defect #747: Uploadfile error ?!ClosedJean-Philippe Lang2008-02-28

Actions
Actions #1

Updated by 延平 贾 over 16 years ago

And thanks for your great software, sorry for my poor english.

Actions #2

Updated by Jean-Philippe Lang over 16 years ago

  • Status changed from New to Closed
  • Target version set to 0.7.2
  • Resolution set to Fixed

Fixed in r1433. Filename will be hashed if needed.

Actions

Also available in: Atom PDF