While googling, I found this discussion of the XML RPC Plugin for Trac. I'm not sure how/whether this plugin is the one you use, but it lists the following Python code as sample code:
import xmlrpclib
server = xmlrpclib.ServerProxy("http://athomas:password@localhost:8080
+/trunk/login/xmlrpc")
server.wiki.putAttachment('WikiStart/t.py', xmlrpclib.Binary(open('t.p
+y').read()))
So, likely, you can use that Python code to get a sample of what you have to send using XML::RPC. It seems to send a different number of paramters than your scample does, though, so maybe it's the wrong end in the tree.
From my cursory look at XML::RPC, your approach of simply sending the base64-encoded data should be OK, but maybe you need to replace it by:
my $result = $xmlrpc->call('ticket.putAttachment',
2,
'Filename',
'Some Description',
sub { +{base64 => encode_base64('data, data
+ - it is always the data')} },
);
... which is what the "Custom Types" section at the end of the documentation suggests.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.