ファイルのようないくつかのファイルを管理するアプリケーションがあり.blend
ます。
.blend
は標準のMIME タイプではないため、このオプションを に追加しますconfig/environment.rb
。
Paperclip.options[:content_type_mappings][:blend] = "application/octet-stream"
値"application/octet-stream"
は、コマンドによって返される値です
$ file -b --mime 'x.blend'
application/octet-stream; charset=binary
$ file -v
file-5.11
私が抱えている問題は、アプリケーションが複数のサーバーにデプロイされており、それらのfile
バージョンが同じではないことです。たとえば、他のサーバーでは次のようになります。
$ file -b --mime 'x.blend'
binary; charset=binary
$ file -v
file-5.17
したがって、ペーパークリップはスプーフィングを検出します
[paperclip] Content Type Spoof: Filename x.blend ([]), content type discovered from file command: binary. See documentation to allow this combination.
content_type_mapping を配列 ( ["application/octet-stream", "binary"]
) として設定しようとしましたが、うまくいきません。
何か考えはありますか?このなりすましチェックを無効にすることはできますか?