##// END OF EJS Templates
Fixed: error when uploading a file with no content-type specified by the browser....
Jean-Philippe Lang -
r1101:5dd3c239d357
parent child
Show More
@@ -42,7 +42,7 class Attachment < ActiveRecord::Base
42 if @temp_file.size > 0
42 if @temp_file.size > 0
43 self.filename = sanitize_filename(@temp_file.original_filename)
43 self.filename = sanitize_filename(@temp_file.original_filename)
44 self.disk_filename = DateTime.now.strftime("%y%m%d%H%M%S") + "_" + self.filename
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 self.filesize = @temp_file.size
46 self.filesize = @temp_file.size
47 end
47 end
48 end
48 end
General Comments 0
You need to be logged in to leave comments. Login now