[rt-users] Download Attachments results in Mason Error

Julian Hein jhein at jhein.de
Fri Jul 20 15:17:37 EDT 2001


Hi,

I could fix the error in rt-2-0-2test1 by commenting 1 line (at --->) in
/opt/rt2/WebRT/html/Ticket/Attachment/dhandler:

--- cut here ---

<%perl>
     my ($ticket, $trans,$attach, $filename);
     my $arg = $m->dhandler_arg;                # get rest of path
     if ($arg =~ '^(\d+)/(\d+)') {
        $trans = $1;
        $attach = $2;
     }
    else {
        Abort("Corrupted attachment URL.");
        }
     my $AttachmentObj = new RT::Attachment($session{'CurrentUser'});
     $AttachmentObj->Load($attach) || Abort("Attachment '$attach' could
not be loaded");


     unless ($AttachmentObj->id) {
        Abort("Bad attachment id. Couldn't find attachment
'$attach'\n");
    }
     unless ($AttachmentObj->TransactionId() == $trans ) {
        Abort("Bad transaction number for attachment. $trans should
be".$AttachmentObj->TransactionId() ."\n");

     }
     my $content_type = $AttachmentObj->ContentType || 'text/plain';
-->  # SetContentType($content_type);
     $m->out($AttachmentObj->Content);
     $m->abort;
</%perl>

--- cut here ---

Julian





More information about the rt-users mailing list