I was able to get this to work with your help.
thank you for the suggestions, I truly appreciate it.
Best Regards,
Michael Hirst
Thilo Stapff wrote:
First, the name parameter should rather be
name => $attname,
than
name => @attname,
Second, the ars_CreateEntry function, unlike ars_SetEntry, doesn't have
a "getTime" parameter. So this should look like
$entry_id = ars_CreateEntry($ctl, $hdform,
$fields{'Attachment1'} => $hAttachStruct);
instead of
$entry_id = ars_CreateEntry($ctl, $hdform, 0,
$fields{'Attachment1'} => $hAttachStruct);
Since you are determining the attachment size via length(), I assume
that $attachment contains the actual data, not the name of an attachment
file. In this case you have to use
buffer => $attachment,
intstead of
file => $attachment,
Regards,
Thilo Stapff
Michael Hirst wrote:
Hello Listers,
I am running, ARS 6.3, Oracle 9.2, Sun OS.
and I was wondering if anyone can point me in the right direction
for using perl to save attachments to Remedy. I am using perl to
parse incomming emails and then save the information to a Help Desk
6.3 ticket.
I am using the MIME::parser, Entity, Body and ARSPerl to do this and
everything works great except for one thing, attachments. Without the
attachments I am able to save and update just fine.
I have yet to figure out how to get the attachments to save to a ticket.
I can parse out everything, I can even grab the filename, filesize,
file, but when I go to try to add it to the attachment field, it just
fails. I have searched these archives, the web, and permonks and have
found alot of great information that got me this far.
I have tried just submitting the file, or filename, tried using a
simple struct to submit the file,fname, and size, and variations
thereof with no luck.
Can anyone suggest something.
At this point my code is something like(changes as I test):
$hAttachStruct = {
name => @attname,
file => $attachment,
size => length($attachment),
};
Creating the ticket I am using at the moment:
$entry_id = ars_CreateEntry($ctl, $hdform, 0,
$fields{'Attachment1'} => $hAttachStruct);
I have played with many variations of this theme, but am missing
something. Any help would be greatly appreciated.
thank you,
Michael Hirst
University of Arizona
CCIT, Computing and Network Support
520-621-0867
_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
ARSlist:"Where the Answers Are"
_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org ARSlist:"Where
the Answers Are"
_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org ARSlist:"Where the Answers
Are"