app/controllers/attachments_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index a2a9a45..e106d62 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -82,9 +82,10 @@ class AttachmentsController < ApplicationController return end - @attachment = Attachment.new(:file => request.raw_post) + @attachment = Attachment.new @attachment.author = User.current @attachment.filename = params[:filename].presence || Redmine::Utils.random_hex(16) + @attachment.file = request.raw_post saved = @attachment.save respond_to do |format|