summaryrefslogtreecommitdiff
path: root/httemplate/view/attachment.html
diff options
context:
space:
mode:
authormark <mark>2011-08-03 02:23:48 +0000
committermark <mark>2011-08-03 02:23:48 +0000
commit1b0ba17e74f85a7da0d2769a9f0bd2fcd014ca1a (patch)
tree3700b3b9b6b84339fa19746e696a0e166310b05d /httemplate/view/attachment.html
parentf44553b421128e7391f5c06e39c00a8ae80f913d (diff)
avoid corrupt attachments, #13209 and #13877
Diffstat (limited to 'httemplate/view/attachment.html')
-rw-r--r--httemplate/view/attachment.html5
1 files changed, 2 insertions, 3 deletions
diff --git a/httemplate/view/attachment.html b/httemplate/view/attachment.html
index 5fc053967..5827e3d20 100644
--- a/httemplate/view/attachment.html
+++ b/httemplate/view/attachment.html
@@ -1,4 +1,3 @@
-<% $attach->body %>
<%init>
my ($query) = $cgi->keywords;
$query =~ /^(\d+)$/;
@@ -8,9 +7,9 @@ $FS::CurrentUser::CurrentUser->access_right('Download attachment') or die 'acces
my $attach = qsearchs('cust_attachment', { attachnum => $attachnum }) or die "Attachment not found: $attachnum";
die 'access denied' if $attach->disabled;
+$r->subprocess_env('no-gzip' => 1); # disable mod_deflate
$m->clear_buffer;
$r->content_type($attach->mime_type || 'text/plain');
$r->headers_out->add('Content-Disposition' => 'attachment;filename=' . $attach->filename);
-
-
+$m->print($attach->body);
</%init>