[solved] Correct way to set MIME type
Posted: Sat Oct 11, 2014 4:58 am
I'm using a UDT to generate PDF files dynamically via mPDF. I'm calling my UDT with "showtemplate=false" in the query string but was finding that the generated file was receiving the wrong MIME type in the header so that it was displaying as HTML rather than a PDF.
My question is: what is the right way to set the MIME type in my UDT? A Google search revealed a blog post referring to
but I can't find any documentation on this.
I used
and it seems to work fine, but is this the correct method?
My question is: what is the right way to set the MIME type in my UDT? A Google search revealed a blog post referring to
Code: Select all
cmsms()->variables['content-type']
I used
Code: Select all
cmsms()->variables['content-type'] = "application/pdf";