AppleScript base64 and XMLRPC newMediaObject

Now this IS a long shot.

I don’t supposed anyone out there can answer me this… I’m using AppleScript to talk to WordPress with XMLRPC using the metaweblog.newMediaObject call….

I created a AS function like this…
on encodeAsBase64(theFilePath)
set thePath to quoted form of POSIX path of (theFilePath)
set theScript to "openssl base64 < " & thePath
return do shell script theScript
end encodeAsBase64

... and my xml (logged) looks like this...

< ?xml version="1.0" encoding="UTF-8"?>
<methodcall>
<methodname>metaWeblog.newMediaObject</methodname>
<params>
<param>
<value>
<string></string>
</value>
</param>
<param>
<value>
<string>xxx</string>
</value>
</param>
<param>
<value>
<string>xxx</string>
</value>
</param>
<param>
<value>
<string><name>ghost.jpg</name><type>image/jpeg</type><bits>/9j/4AAQSkZJRgABAgAAZABkAAD/7AARRHVja3kAAQAEAAAAPAAA/+4ADkFkb2Jl
AGTAAAAAAf/bAIQABgQEBAUEBgUFBgkGBQYJCwgGBggLDAoKCwoKDBAMDAwMDAwQ
DA4PEA8ODBMTFBQTExwbGxscHx8fHx8fHx8fHwEHBwcND... etc.

Everything seems OK, except I wouldn’t know if something was properly encoded in base64 by looking at it…

This entry was posted in Uncategorized and tagged . Bookmark the permalink.

One Response to AppleScript base64 and XMLRPC newMediaObject

  1. tom says:

    BTW my <s are properly encoded too…

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>