%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC
%# <sales@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
use LWP::MediaTypes;
use RT::Interface::REST;
use File::Temp qw(tempfile);
+my @tmp_files;
$RT::Logger->debug("Got ticket id=$id for comment");
$RT::Logger->debug("Got args @{[keys(%changes)]}.");
}
my $cgi = $m->cgi_object;
-my $ent = MIME::Entity->build(Type => "multipart/mixed");
+my $ent = MIME::Entity->build(
+ Type => "multipart/mixed",
+ 'X-RT-Interface' => 'REST',
+);
$ent->attach(Data => $changes{Text}) if $changes{Text};
my $i = 1;
my $buf;
my ($w, $tmp) = tempfile();
my $info = $cgi->uploadInfo($fh);
+ push @tmp_files, $tmp;
while (sysread($fh, $buf, 8192)) {
syswrite($w, $buf);
}
OUTPUT:
+
+unlink @tmp_files;
return [ $c, $o, $k, $e ];
</%INIT>