Defect #18667

Attachment content type not set when uploading attachment

Added by Thomas Löber almost 4 years ago. Updated over 3 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:

0%

Category:Attachments
Target version:2.6.1
Resolution:Fixed Affected version:

Description

Hi,

I noticed that the attachment content type is not set when uploading an attachment. Do you also experience this behaviour?

I think this is caused by setting the file contents before setting the file name. (The content type is determined by the file name).

I have attached a patch (from my personal Git repo) which resolves this problem.

Regards,
Thomas

set_attachment_content_type_on_upload.patch Magnifier - AttachmentController#upload patch (755 Bytes) Thomas Löber, 2014-12-17 11:51

Associated revisions

Revision 13787
Added by Jean-Philippe Lang almost 4 years ago

Attachment content type not set when uploading attachment (#18667).

Revision 13810
Added by Jean-Philippe Lang over 3 years ago

Fixed order syntax for Rails 3 (#18667).

History

#1 Updated by Jean-Philippe Lang almost 4 years ago

  • Status changed from New to Resolved
  • Assignee set to Jean-Philippe Lang
  • Target version set to 2.6.1
  • Resolution set to Fixed

Fixed in r13787, thanks for reporting this. The fix was done at model level instead.

#2 Updated by Jean-Philippe Lang over 3 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF