I’m trying to send images to a wordpress blog using xmlrpc using the script below. The images aren’t getting decoded by wordpress and I’m reasonably certain that this can be fixed by wrapping the base64 encoded data in tags. My problem, though, is that xmlrpc seems to be encoding the tag’s angle brackets to >/< tokens. Does anyone have any idea how I can prevent this.
thanks.
use framework "Foundation"
use scripting additions
set filePath to "/Users/kimaldis/Desktop/t.jpg"
set base64 to do shell script "openssl base64 -in " & quoted form of POSIX path of filePath
tell application "http://nextgen.dev/wp/xmlrpc.php"
set params to {1, "admin", "admin", {|name|:"_DSC3996.jpg", bits:"<base64>" & base64 & "<base64>", gallery:8, overwrite:1}}
set gals to call xmlrpc {method name:"ngg.uploadImage", parameters:params}
end tell