I am downloading data in excel format in my Rails 4 app using send_data method as mentioned below.
send_data collection.to_csv(col_sep: "\t"),
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
filename: 'filename.xls'
I am able to download the data, but while opening the downloaded excel file, i am getting below warning message.
The file format and extension of 'file.xls' don't match. The file could be corrupted or unsafe.
Unless you trust its source, dont open it. D want to open it anyway?
Even it is warning, it would cause confusion to customers while downloading and opening the file. Any one has any clue about, what is it about and how could it be fixed?
Any help would be greatly appreciated.