When I run file --mime-type sample.xls
from the terminal it reports the mimetype as: ‘application/vnd.ms-excel’. Whereas Shrine describes the mimetype as ‘application/x-ole-storage’.
Im not sure what I’m doing wrong here. Here’s my uploader:
class AttachmentUploader < Shrine
MAX_SIZE = 50*1024*1024
plugin :remove_attachment
plugin :validation_helpers
plugin :determine_mime_type, analyzer: :marcel
Attacher.validate do
puts get.mime_type
validate_mime_type FileType.pluck(:mimetype)
validate_size 0..MAX_SIZE
end
end