We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 49667
    • 59 Posts


    I use MODx Evolution and included into my htaccess file the following:

    <IfModule mod_headers.c>
        <FilesMatch "\.jpg$">
          Header append Content-Disposition "attachment;"
        </FilesMatch>
    
        <FilesMatch "\.jpeg$">
          Header append Content-Disposition "attachment;"
        </FilesMatch>
    
        <FilesMatch "\.png$">
          Header append Content-Disposition "attachment;"
        </FilesMatch>
    </IfModule>


    I have a download button for each image that can be downloaded, like so:

    <div class="box download-box">
                            <a class="button" href="[*template-variable-image*]">Download</a>


    The above work perfectly.

    Now I added another button for a user to see the image in full scale in a separate browser tab with this code:

    <h2 class="thumb-caption"><span data-href="[*template-variable-image*]" target="_blank">PREVIEW</span></h2>


    Now when the user clicks "PREVIEW" the content disposition attachment box appears for download. How can I get the "PREVIEW" to show the preview of the image the way I planned and NOT the content download box???