I am trying to set the content type of a page to excel by doing the foll:
1. put header("Content-type: application/vnd.ms-excel"); header("Content-Disposition: attachment; filename=$fileName"); in the snippet
2. specify content-type as "text/html" in the content-type drop down in modx for the page
It works but the problem is that opening the downloaded excel sheet gives a message "The file is in a different format than specified by the extension. do you want to open the file?". Also the grid lines are missing from the sheet.
I assume this is because the content type is specified as text/html in modx.
Is there any way to specify a content type other than the drop down options? maybe a hack in the modx code?
Or is there something else that is wrong and how do i fix it?
No need to hack, you can add content-types : in the manager go to
Tools > Configuration >> Custom content type and add what you need
.: COO - Commerce Guys - Community Driven Innovation :.
MODx est l'outil id