Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

ZF2 XML_RPC Problem Sending Image Content #7619

Closed
dr-abadis opened this issue Aug 27, 2015 · 1 comment
Closed

ZF2 XML_RPC Problem Sending Image Content #7619

dr-abadis opened this issue Aug 27, 2015 · 1 comment
Labels

Comments

@dr-abadis
Copy link

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?

@GeeH
Copy link

GeeH commented Jun 28, 2016

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
New issue can be found at: zendframework/zend-xmlrpc#20

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants