I am using paperclip to upload CSV files. I need to validate them, that only CSV files can be uploaded:
validates_attachment :uploaded_file_csv, content_type: { content_type: ['text/csv']} , message: "is not in CSV format"
But I have a problem with this validator: If user uploading file from Windows operation system or file was created by using Microsoft Office - this validator rising error that file is invalid. How to validate microsoft/csv files?