[rt-users] Help with scrip for Custom Field

Kevin Falcone falcone at bestpractical.com
Mon Aug 8 10:43:13 EDT 2011


On Fri, Aug 05, 2011 at 03:18:54PM -0700, Kenneth Crocker wrote:
>    To all,
> 
>    I have a Custom Field with the type=Upload multiple images. I want to put in an attachment
>    (gif or jpeg) from an email.
>    The scrip I have written uses this to get the pic:
> 
>    my $trans = $self->TransactionObj;
>    my $pic = $trans->Attachments->First->ContentType(Value => 'image/gif'); (this 'gif' variation
>    was merely to try the concept. I can try variations for jpeg later).
> 
>    The result was no pic uploaded and next to the CF name (on the ticket display) was
>    'multipart/mixed'.
> 
>    Inside the Update screen, these was the name of the CF followed by a checkbox and the
>    'multipart/mixed'.
> 
>    Obviously I'm missing something. I went to Attachments_Overlay.txt and didn't really see
>    anything that helped (obviously - duh).

Kenn

Your code gets the first attachment and then calls the ContentType
method on it (which takes no arguments) and that returns the
Content-Type of multipart/mixed, which is expected.

You need to loop through the attachments and get your gif (or just
Limit down).

-kevin

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20110808/0ee6829d/attachment.sig>


More information about the rt-users mailing list