We launched new forums in March 2019β€”join us there. In a hurry for help with your website? Get Help Now!
    • 15807
    • 12 Posts
    Hi all,

    I would like to set a non text/plain content type for a text file (.asc).

    The idea is, to get a download dialog by clicking on the link for this particular file - instead of the content presented directly inside the web browser. I tried adding different Target MIME types (application/zip, pdf, asc to octet-stream) on the link itself, adding custom Content types (on the site settings page), changing the extension to something completely unknown - but the server response was always "text/plain".

    How can this be influenced?

    Thanks a lot,
    Ki
      • 28042 β˜† A M B β˜†
      • 24,524 Posts
      I suspect that this is a "feature" of your browser. It sees that this is really a text file, so displays it as such. Depending on your browser, you may be able to configure it to download instead of displaying.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 15807
        • 12 Posts
        Hi Sottwell

        Thanks for your reply.

        It seems not a "feature" of the browser as the http response header (from the apache server) shows a Content-Type=text/plain; charset=ISO-8859-1. Firefox in "View Page Info" also.

        Any other assumption? Or how do you think should this be implemented?

        Thanks,
        Ki
          • 15807
          • 12 Posts
          Hi ganeshXL,

          Thanks for your reply!

          I first just had a file and a link to it (in /assets/files/). But it’s the better way as a resource within MODx and the content-disposition set. Works like a charm. ;-)

          Ki