<div dir="ltr"><div class="gmail_default" style="font-size:x-small">Hi Emmanuel,</div><div class="gmail_default" style="font-size:x-small"><br></div><div class="gmail_default" style="font-size:x-small">Thanks! Never occurred to me to use standard PERL code. Will try this out as soon as I can.</div>
<div class="gmail_default" style="font-size:x-small"><br></div><div class="gmail_default" style="font-size:x-small">Once again, thanks for taking time to help out.</div><div class="gmail_default" style="font-size:x-small">
<br></div><div class="gmail_default" style="font-size:x-small">PJ</div><div class="gmail_default" style="font-size:x-small"><br></div><div class="gmail_default" style="font-size:x-small"><p style="margin:0px;font-size:13px;font-family:Arial;color:rgb(35,35,35)">
> here is an example I used to dump tickets to files:</p>
<p style="margin:0px;font-size:13px;font-family:Arial;color:rgb(35,35,35)">></p>
<p style="margin:0px;font-size:13px;font-family:Arial;color:rgb(35,35,35)">></p>
<p style="margin:0px;font-size:13px;font-family:Arial;color:rgb(35,35,35)">> my $Attachments = $Transaction->Attachments;</p>
<p style="margin:0px;font-size:13px;font-family:Arial;color:rgb(35,35,35)">> $Attachments->OrderBy( FIELD => 'id', ORDER => 'ASC' );</p>
<p style="margin:0px;font-size:13px;font-family:Arial;color:rgb(35,35,35)">> while ( my $Attachment = $Attachments->Next ) {</p>
<p style="margin:0px;font-size:13px;font-family:Arial;color:rgb(35,35,35)">> next unless ( $Attachment->Filename );</p>
<p style="margin:0px;font-size:13px;font-family:Arial;color:rgb(35,35,35)">> my $filename = $Attachment->Filename;</p>
<p style="margin:0px;font-size:13px;font-family:Arial;color:rgb(35,35,35)">> $filename =~ s/\//-/g;</p>
<p style="margin:0px;font-size:13px;font-family:Arial;color:rgb(35,35,35)">> my $file_path = $attachments_dir."/".$Ticket->id."-".$filename;</p>
<p style="margin:0px;font-size:13px;font-family:Arial;color:rgb(35,35,35)">> open( FILE, '>' ,$file_path ) or die "Can't open $file_path: $!\n";</p>
<p style="margin:0px;font-size:13px;font-family:Arial;color:rgb(35,35,35)">> print FILE $Attachment->OriginalContent;</p>
<p style="margin:0px;font-size:13px;font-family:Arial;color:rgb(35,35,35)">> close ( FILE );</p>
<p style="margin:0px;font-size:13px;font-family:Arial;color:rgb(35,35,35)">> }</p></div></div>