Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

XML-RPC and base64



Another question related to XML-RPC types and AppleScript...

I'm experimenting with Zoto's API, in order to develop an upload script to use along with iPhoto.

To post a new picture on my accout, according to the documentation available here:

http://zoto.com/zapi

I have to call:

images.add( <Authentication Credentials>, <Title>, <Filename>, <Description>, <Data> )

It's my understanding that the last parameter, <Data> should be the base64 encoded data of the picture, but I have no idea on how to pass it properly to the "call xmlrpc" command.

When using:

call xmlrpc {method name: "images.add", parameters: {{"user", "pass"}, "title", "test.jpg", "description", pic}}

Where pic, the last parameter, is either the result of:

set pic to alias "Gladis HD:Users:federico:Desktop:test.jpg"

Or:

set pic to read alias "Gladis HD:Users:federico:Desktop:test.jpg" as data
-- "as data" was a guess I tried when I saw that base64-encoded data from a server's reply was returned as «data ...»


I get an error from Zoto's XML-RPC server.

I hacked up a PHP script to dump the raw XML data sent by AppleScript. It seems that while the parameter's type is guessed correctly, AppleScript "forgets" to fill its content, so that the <param> tag for the last parameter looks like this:

<param>
    <value>
        <base64>

        </base64>
    </value>
</param>

There is an empty line inside <base64>.

So, how can I send base64-encoded data to an XML-RPC server?

TIA,

- fm


_______________________________________________ Do not post admin requests to the list. They will be ignored. Applescript-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/applescript-users/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.