Ruby on Rails Friday, January 12, 2018

Hi,

I have extension-less DICOM files that I need to determine the proper MIME type on when uploaded.

file  --b  --mime-type  MyFile

reports the files as application/dicom so I know they are valid but when uploaded through Rails they get the type 'applcation/octet-stream'. Is there an easy way to change this behaviour preferably without monkey patching? Could this be done through Rack middleware to provide a general solution?

I am running version 5.2.0.beta2 on Ruby 2.5.0

/bjarki

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/377623dd-ffa5-4c54-a3ec-c8cace081ef0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment