communigate provisioning phase 2: add svc_domain.trailer -> communigate TrailerText...
[freeside.git] / httemplate / view / attachment.html
1 <% $attach->body %>
2 <%init>
3 my ($query) = $cgi->keywords;
4 $query =~ /^(\d+)$/;
5 my $attachnum = $1 or die 'Invalid attachment number';
6 $FS::CurrentUser::CurrentUser->access_right('Download attachment') or die 'access denied';
7
8 my $attach = qsearchs('cust_attachment', { attachnum => $attachnum }) or die "Attachment not found: $attachnum";
9 die 'access denied' if $attach->disabled;
10
11 $m->clear_buffer;
12 $r->content_type($attach->mime_type || 'text/plain');
13 $r->headers_out->add('Content-Disposition' => 'attachment;filename=' . $attach->filename);
14
15
16 </%init>