Zoho - Trademark Blogs   Forums   Contact Us   Writer Home   Toll Free : 888 900 9646
API METHOD - (< Back)

writer.uploadImage - Upload an image to the document


Arguments


1. [struct] - required*

Containing Keys:

Field Description
filename (optional)

[scalar] - optional - Image name to be uploaded to the existing document.

contenttype

[scalar] - required* - Specify the type of image to be uploaded (ex - .jpg, .gif ).

content

[scalar] - required* - Encode the image content using base64encoding.



Sample call to writer.uploadImage

POST /interface/xmlrpc HTTP/1.0
Host: http://www.writer.zoho.com/
Content-Type: text/xml
Content-Length:

<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<methodCall>

<methodName>writer.uploadImage</methodName>
<params>
<param>
<value>
<struct>
<member>
<name>filename</name>
<value><string>testimage</string></value>
</member>
<member>
<name>contenttype</name>
<value><string>jpg</string></value>
</member>
<member>
<name>content</name>
<value><string>img</string></value>
</member>
</struct>
</value>
</param>
</params>

</methodCall>

Note: **The image should be encoded using base64encoding before passing it into the content tag of xml.

Response

1. [methodResponse] - required*

Containing Keys:
Sample return value for writer.uploadImage

HTTP/1.1 200 OK
Connection: close
Content-Length:

Content-Type: text/xml
Date: Wed 01 Nov 2006 23:45:59 GMT
Server: Apache/1.3.4 (Unix)

<methodResponse>

<url>
http://localhost:8080/ImageDisplay.im?name=testimage.jpg&accId=60000000145
</url>

</methodResponse>