I have an application managing some files like .blend
files.
.blend
is not a standard mime type, so I add this options into config/environment.rb
:
Paperclip.options[:content_type_mappings][:blend] = "application/octet-stream"
The value "application/octet-stream"
is the value returned by the command
$ file -b --mime 'x.blend'
application/octet-stream; charset=binary
$ file -v
file-5.11
The issue I have is that the application is deployed on several servers, and they have not the same file
version. For example, in an other server:
$ file -b --mime 'x.blend'
binary; charset=binary
$ file -v
file-5.17
So Paperclip detects a spoof
[paperclip] Content Type Spoof: Filename x.blend ([]), content type discovered from file command: binary. See documentation to allow this combination.
I tried to set content_type_mapping as an array (["application/octet-stream", "binary"]
) but it doesn't work.
Have you any idea? Is it possible to disable this spoof check?