opensubscriber
   Find in this group all groups
 
Unknown more information…

d : dev@otrs.org 5 October 2010 • 9:25PM -0400

[dev] SOAP, PHP and Attachment Handling
by Eifler, Eric

REPLY TO AUTHOR
 
REPLY TO GROUP



Hi all,
I have a problem regarding the SOAP API and using PHP. I am trying to
upload files to attach to an article.
As far as i know, the attachment has to be encoded using base64. This
happens on php-side:

------------------------------------------------------------------------
--------
    public function articleWriteAttachment($attachment, $article_id) {
        if (is_array($attachment)) {
            $data = array(
                "Content",
chunk_split(base64_encode($attachment['data'])),
                "ContentType",  $attachment['type'],
                "Filename",     $attachment['name'],
                "ArticleID",    $article_id,
                "UserID",       1,
            );
            self::makeCall('TicketObject', 'ArticleWriteAttachment',
$data);
        }
    }
------------------------------------------------------------------------
---------

OTRS creates the attachment with success, but as i open the file, it
looks like ist still base64, so the file is unusable. If i'm not
converting the data to base64, i get an error from SOAP.

Maybe some one can help me out?

Eric Eifler
---------------------------------------------------------------------
OTRS mailing list: dev - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/dev
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/dev

Bookmark with:

Delicious   Digg   reddit   Facebook   StumbleUpon

opensubscriber is not affiliated with the authors of this message nor responsible for its content.