]> git.uio.no Git - usit-rt.git/blobdiff - share/html/REST/1.0/ticket/comment
Dev to 4.0.11
[usit-rt.git] / share / html / REST / 1.0 / ticket / comment
index 23397df2068e170c8953e77f871f6a9ebd6ffefa..475e3a88db89b9feed5bacb305ee2299a56a54f5 100644 (file)
@@ -55,6 +55,7 @@ use MIME::Entity;
 use LWP::MediaTypes;
 use RT::Interface::REST;
 use File::Temp qw(tempfile);
+my @tmp_files;
 
 my $ticket = RT::Ticket->new($session{CurrentUser});
 my $object = $r->path_info;
@@ -122,6 +123,7 @@ foreach my $att (@atts) {
     if ($fh) {
         my $buf;
         my ($w, $tmp) = tempfile();
+        push @tmp_files, $tmp;
         my $info = $cgi->uploadInfo();
 
         while (sysread($fh, $buf, 8192)) {
@@ -174,6 +176,8 @@ if ($k->{Status}) {
 }
 
 OUTPUT:
+
+unlink @tmp_files;
 </%INIT>
 RT/<% $RT::VERSION %> <% $status %>