base64 encoding of wiki attachment
Posted: Fri Jul 17, 2009 10:47 am
Greetings,
I'm writing a class called MoinMoinProxy to allow programmatic access to the internal wiki using XMLRPC. It works for getting and putting pages, but I'm stuck on uploading an attachment.
Here's an example of the XML I need to generate to send to the MoinMoin server:
<name>params</name>
<value><array><data>
<value><string>AbcPage</string></value>
<value><string>dontpanic.png</string></value>
<value><base64>
iVBORw0KGgoAAAANSUhEUgAAAHgAAABaCAMAAAEz2VJLAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJ
zZzUud94FKRIEb5N2+d+6/9A9U8uWj090n8A2xrpEjyby7UAAAAASUVORK5CYII=
</base64></value>
</data></array></value>
How do I load an arbitrary file (png, jpg, pdf, ...) in JADE and convert it to base64?
Thanks.
David
I'm writing a class called MoinMoinProxy to allow programmatic access to the internal wiki using XMLRPC. It works for getting and putting pages, but I'm stuck on uploading an attachment.
Here's an example of the XML I need to generate to send to the MoinMoin server:
<name>params</name>
<value><array><data>
<value><string>AbcPage</string></value>
<value><string>dontpanic.png</string></value>
<value><base64>
iVBORw0KGgoAAAANSUhEUgAAAHgAAABaCAMAAAEz2VJLAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJ
zZzUud94FKRIEb5N2+d+6/9A9U8uWj090n8A2xrpEjyby7UAAAAASUVORK5CYII=
</base64></value>
</data></array></value>
How do I load an arbitrary file (png, jpg, pdf, ...) in JADE and convert it to base64?
Thanks.
David