On Oct 16, 9:39 am, Remi <[email protected]> wrote:
> Hi,
>
> you can use the xmlrpc plugin :http://trac-hacks.org/wiki/XmlRpcPlugin
>
> with function boolean wiki.putAttachment(string path, base64 data)
>
>
> > Is there anyway to make an attachment to a Trac page from
> > a command line command?
The plugin works well, and you can even use something like "curl" with
either xml-rpc or json-rpc (vary header + body content).
Here is a snippet for you that uses json-rpc (the actual base64
representation of a file is left out to keep the example easily
readable - convert and replace inside the placeholder...):
user: ~ > cat body.json
{
"id": 123,
"params": ["WikiStart", "feed2.png", "test image", {"__jsonclass__":
["binary", "<base64-representation>"]}],
"method": "wiki.putAttachmentEx"
}
user: ~ > curl -X POST -H "Content-Type: application/json" --data
@body.json http://my-server/project/jsonrpc
:::simon
https://www.coderesort.com
http://www.ohloh.net/accounts/osimons
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac
Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---