Skip to content
This repository was archived by the owner on Apr 28, 2020. It is now read-only.
This repository was archived by the owner on Apr 28, 2020. It is now read-only.

ZF2 XML_RPC Problem Sending Image Content #20

@GeeH

Description

@GeeH

This issue has been moved from the zendframework repository as part of the bug migration program as outlined here - http://framework.zend.com/blog/2016-04-11-issue-closures.html


Original Issue: zendframework/zendframework#7619
User: @narimani
Created On: 2015-08-27T07:37:36Z
Updated At: 2015-11-06T22:17:26Z
Body
Hi. I am trying to send a photo via xml_rpc like this:

$data = array(
 'phpads55deb65dd5ca45.43027895',
'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);

I get the request via Fiddler witch shows this:

POST http://example.com/api/v2/xmlrpc/ HTTP/1.1
Host: example.com
Connection: close
Accept-Encoding: gzip, deflate
Content-Type: text/xml; charset=utf-8
Content-Length: 771
Accept: text/xml
User-Agent: Zend_XmlRpc_Client

<?xml version="1.0" encoding="UTF-8"?>
<methodCall><methodName>ox.addBanner</methodName><params><param><value><string>phpads55deb65dd5ca45.43027895</string></value></param><param><value><struct><member><name>campaignId</name><value><int>1</int></value></member><member><name>bannerName</name><value><string>khgjjhj</string></value></member><member><name>aImage</name><value><struct><member><name>filename</name><value><string>logo.png</string></value></member><member><name>content</name><value><string>�PNG&#13;
�
</string></value></member></struct></value></member><member><name>comments</name><value><string>dfgdgdfgdfg</string></value></member><member><name>storageType</name><value><string>web</string></value></member></struct></value></param></params></methodCall>

And as you can see the full image is not there in the request. What is the problem?


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions