Thanks guys!  As always, you're a big help. 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Thilo Stapff
Sent: Wednesday, July 16, 2008 9:34 AM
To: ARSperl User Discussion
Subject: Re: [Arsperl-users] Attachments via ars_CreateEntry

Yes, it's possible. First, construct a data structure for the attachment:

my %attachStruct = (
   name   => $name,
   size   => length($buffer),
   buffer => $buffer,
);

In this example the $buffer variable contains the attachment data.

Alternatively the data structure might only refer to a file instead of 
containing the actual data:

my %attachStruct = (
   name   => $fileName,
   size   => $fileSize,
   file   => $fileName,
);

Be aware, however, that the second variant might crash with older 
versions of ARSperl.

The attachment structure can then be passed to ars_CreateEntry just like 
any other field value:

my $entryId = ars_CreateEntry( $ctrl, $form,
  $fieldId  => \%attachStruct,
  $fieldId2 => ....,
  ....
);
die "ars_CreateEntry($form): $ars_errstr\n" if $ars_errstr;


Regards,
Thilo



Steve McDonald wrote:
>  
> Hello!
> 
> Is it possible to submit an attachment via ars_CreateEntry?  I have a webform 
> with an attachment field and would like to submit the attached file with the 
> ticket.
> 
> Thanks in advance for your help.
> 
> 
> Steve
> 
> 
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Arsperl-users mailing list
> Arsperl-users@arsperl.org
> https://lists.sourceforge.net/lists/listinfo/arsperl-users
> 


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Arsperl-users mailing list
Arsperl-users@arsperl.org
https://lists.sourceforge.net/lists/listinfo/arsperl-users


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Arsperl-users mailing list
Arsperl-users@arsperl.org
https://lists.sourceforge.net/lists/listinfo/arsperl-users

Reply via email to