Help with scrip for Custom Field

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).

Any help would be appreciated.

Kenn
LBNL

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

Kevin,

I don’t understand the term “limitdown”, but I’ll try to create a loop. Am I
correct with the code
"Attachments->First->ContentType(Value => ‘image/gif’)" and should that be
the main condition in the loop (got an example)?

Thanks.

Kenn
LBNLOn Mon, Aug 8, 2011 at 7:43 AM, Kevin Falcone falcone@bestpractical.comwrote:

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


2011 Training: http://bestpractical.com/services/training.html

I don’t understand the term “limitdown”, but I’ll try to create a loop. Am I correct with the
code
"Attachments->First->ContentType(Value => ‘image/gif’)" and should that be the main condition
in the loop (got an example)?

Limit meaning add Limits to only get images back first

That code is not correct, see my description of what it is doing in my
original mail (quoted below).

 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.

There should be examples in the wiki and the list archive of looping
through attachments.

-kevin

Kevin,

Thanks. Sorry for the ignorant questions. I’m not a perl programmer. I just
try to cobble examples together and test them out.

I’ll look thru that. Hopefully there’s an example of “limit” code for
images.

Thanks again.

Kenn
LBNLOn Mon, Aug 8, 2011 at 9:38 AM, Kevin Falcone falcone@bestpractical.comwrote:

On Mon, Aug 08, 2011 at 09:23:03AM -0700, Kenneth Crocker wrote:

I don’t understand the term “limitdown”, but I’ll try to create a
loop. Am I correct with the
code
"Attachments->First->ContentType(Value => ‘image/gif’)" and should
that be the main condition
in the loop (got an example)?

Limit meaning add Limits to only get images back first

That code is not correct, see my description of what it is doing in my
original mail (quoted below).

 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.

There should be examples in the wiki and the list archive of looping
through attachments.

-kevin


2011 Training: http://bestpractical.com/services/training.html