From c42f6268827d21793d146609eaf5e2bdbc1a9c17 Mon Sep 17 00:00:00 2001 From: Cobalt74 Date: Wed, 17 Sep 2014 08:38:19 +0200 Subject: [PATCH] Update for content_type add 'application/excel','application/vnd.ms-excel', 'application/vnd.msexcel', 'text/anytext' --- app/models/csv_import.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/csv_import.rb b/app/models/csv_import.rb index 9980a88..5fe7ebd 100755 --- a/app/models/csv_import.rb +++ b/app/models/csv_import.rb @@ -11,7 +11,7 @@ class CsvImport has_attached_file :csv validates_attachment :csv, :presence => {:message => "Oops! Please select a CSV file to import."}, - :content_type => { :content_type => ['text/csv','text/comma-separated-values','application/csv','application/octet-stream'], :message => "Oops! Please upload a file with the extension of csv." }, + :content_type => { :content_type => ['text/csv','text/comma-separated-values','application/csv','application/octet-stream','application/excel','application/vnd.ms-excel', 'application/vnd.msexcel', 'text/anytext'], :message => "Oops! Please upload a file with the extension of csv." }, :size => { :greater_than => 0.kilobytes, :message => 'Oops! This file has no data. Please upload a file with some data.' } def initialize(attributes={})