Revision 1115
Added by Jean-Philippe Lang over 17 years ago
trunk/app/models/attachment.rb | ||
---|---|---|
42 | 42 |
if @temp_file.size > 0 |
43 | 43 |
self.filename = sanitize_filename(@temp_file.original_filename) |
44 | 44 |
self.disk_filename = DateTime.now.strftime("%y%m%d%H%M%S") + "_" + self.filename |
45 |
self.content_type = @temp_file.content_type.chomp |
|
45 |
self.content_type = @temp_file.content_type.to_s.chomp
|
|
46 | 46 |
self.filesize = @temp_file.size |
47 | 47 |
end |
48 | 48 |
end |
Also available in: Unified diff
Fixed: error when uploading a file with no content-type specified by the browser.