• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
XML-RPC and base64
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

XML-RPC and base64


  • Subject: XML-RPC and base64
  • From: Federico <email@hidden>
  • Date: Fri, 17 Feb 2006 20:38:44 +0100

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: This email sent to email@hidden
  • Prev by Date: Toggle Screensaver
  • Next by Date: Re: Toggle Screensaver
  • Previous by thread: Re: Toggle Screensaver
  • Next by thread: Ical
  • Index(es):
    • Date
    • Thread