Defect #1089
attachement's name maybe invalid.
| Status: | Closed | Start: | 2008-04-23 | |
| Priority: | Normal | Due date: | ||
| Assigned to: | - | % Done: | 0% |
|
| Category: | Attachments | |||
| Target version: | 0.7.2 | |||
| Affected version: | 0.7.0-RC1 |
Resolution: | Fixed |
|
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.
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
| duplicated by Defect #1243 | Uploading of attachment with Non-ascii filename fails when host on windows | Closed | 2008-05-15 | ||
| duplicated by Defect #747 | Uploadfile error ?! | Closed | 2008-02-28 |