I have some code that has been working for the last few years on RT 4.0.8 and I’ve just installed 4.4.4 and am testing the upgrade. I notice that when my code runs and tries to create a ticket comment with an attachment (.tar.gz) on 4.0.8 it all works correctly but on 4.4.4 it creates the comment correctly and attaches the something.tar.gz file to it but it sets the content type to text/plain and then tries to display the binary data in the RT ticket. I’ve checked on 4.0.8 and the difference appears to be the display of the binary data happens in 4.4.4 but not in 4.0.8 even though both say text/plain. On 4.0.8 it displays “Message body is not shown because sender requested not to inline it.” and on 4.4.4. it displays a bunch of stuff in wingdings font.
How can I get it to set the mime type of the attachment to something like application/gzip?
# Now bits used to attach the logfile to the raised ticket
my $attachdata = "id: %s
Action: comment
Text: Asterisk Logfile for SIP account %s attached
Attachment: %s";
...
if ($ticketid != 0)
{
$url = sprintf("%s/REST/1.0/ticket/%s/comment", $rturl, $ticketid);
$data = sprintf($attachdata, $ticketid, $accountcode, "$accountcode-asterisk.log.gz");
my $commentreq = POST "$url",
Content_Type => 'form-data',
Content => [ content => "$data", attachment_1 => [ "$tmpfn.gz" ],
referer => "$rturl";
$response = $browser->request($commentreq);
if ($response->is_success)
{
....
I tried adding various combinations of contenttype =>, ContentType =>, FileType =>, MimeType => inside the Content => portion of my POST but it seems to make zero difference.
Any and all pointers gratefully accepted!
Thanks
Trevor