summaryrefslogtreecommitdiffstats
path: root/app/controllers/attachments_controller.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-10-18 21:06:35 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-10-18 21:06:35 +0000
commit251f263abdc5ee71def60e6fa8cba1f71adb617c (patch)
tree7034d7c1de96037f4e25e23c8e294bc8a984ca96 /app/controllers/attachments_controller.rb
parent79c1ec7adc3c8fb8591466b04033a5cf4da735be (diff)
downloadredmine-251f263abdc5ee71def60e6fa8cba1f71adb617c.tar.gz
redmine-251f263abdc5ee71def60e6fa8cba1f71adb617c.zip
Let the attachment filename be specified on upload (#12125).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10678 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/attachments_controller.rb')
-rw-r--r--app/controllers/attachments_controller.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb
index 74a11a1c7..13871c323 100644
--- a/app/controllers/attachments_controller.rb
+++ b/app/controllers/attachments_controller.rb
@@ -84,7 +84,7 @@ class AttachmentsController < ApplicationController
@attachment = Attachment.new(:file => request.raw_post)
@attachment.author = User.current
- @attachment.filename = Redmine::Utils.random_hex(16)
+ @attachment.filename = params[:filename].presence || Redmine::Utils.random_hex(16)
if @attachment.save
respond_to do |format|