Jump to content

XML RPC sending image

Hamed Narimani

Recommended Posts

Hi Everybody!

I am working with Revive Adserver with XML_RPC API. The problem is that I can not call AddBanner with an image file attached.

I Used this part of code :

$data = array(
    'aImage' => array(
        'filename' => $file['aImage']['name'],
        'content' => file_get_contents($file['aImage']['tmp_name']),
    'campaignId' => 1,
    'storageType' => 'web'

$this->client = new Client('http://example.com/api/v2/xmlrpc/');
$this->client->call('ox.addBanner',  $data);

It sends this Error

XML error: Invalid character at line 2

I made a question at stackoverflow too.

Should I use any encoding? I used base64 but didnt work!

Edited by Hamed Narimani
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...