【发布时间】:2015-07-07 21:12:56
【问题描述】:
我使用 MODx Evolution,并在我的 htaccess 文件中包含以下内容:
<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>
我为每个可以下载的图像都有一个下载按钮,如下所示:
<div class="box download-box">
<a class="button" href="[*template-variable-image*]">Download</a>
以上代码完美运行。
现在我添加了另一个按钮,用户可以使用以下代码在单独的浏览器选项卡中查看完整的图像:
<h2 class="thumb-caption"><span data-href="[*template-variable-image*]" target="_blank">PREVIEW</span></h2>
现在,当用户单击“预览”时,会出现内容配置附件框以供下载。我怎样才能让“预览”以我计划的方式而不是内容下载框显示图像的预览???
【问题讨论】:
标签: .htaccess modx content-disposition modx-evolution