We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9207 ☆ A M B ☆
    • 2,475 Posts
    Sorta a weird thing here: is there a way to have a MODx resource that has NO content type? What I want is the script on the page (i.e. a Snippet) to dynamically determine which content type to use, then print the appropriate headers. This is a download page, so it might have to be used to cough up a download of a .doc, a .pdf, or an .xls file -- each of those content types uses its own custom MIME type.

    Normally, I'd just create a static file for this, but it's arguably a bit more secure to lock down this download page because it's intended for use only by logged in users.

    You can't save a new content type without specifying a MIME type, so that doesn't bode well for housing this script inside of MODx.
      • 9207 ☆ A M B ☆
      • 2,475 Posts
      There is a context-wide setting: set_header=0 but this would play havoc on the permissions. MODX does not write the headers until modResponse has parsed the output... so maybe I can tinker with that somehow?