[xwiki-users] What is the format of attachments in XAR?
Hi, I'm trying to retrieve attachments stored in a XAR export file. According to documentation (see http://extensions.xwiki.org/xwiki/bin/view/Extension/XAR+Module+Specificatio...) XML node <attachment> contains everything I need to get files content but how is encoded and how to decode the node <content> ? Thanks for your answers, best regards, -- View this message in context: http://xwiki.475771.n2.nabble.com/What-is-the-format-of-attachments-in-XAR-t... Sent from the XWiki- Users mailing list archive at Nabble.com.
Hi, It's a Base64 encoding so you should be able to use on Linux any base64 decoder. For example, on Linux (I guess on Mac it must be similar), you can do cat your-content.txt | base64 -d or shorter base64 -d your-content.txt I hope this helps, Sincerely, On 27/04/2016 08:33, xrichard wrote:
Hi,
I'm trying to retrieve attachments stored in a XAR export file.
According to documentation (see http://extensions.xwiki.org/xwiki/bin/view/Extension/XAR+Module+Specificatio...) XML node <attachment> contains everything I need to get files content but how is encoded and how to decode the node <content> ?
Thanks for your answers, best regards,
-- View this message in context: http://xwiki.475771.n2.nabble.com/What-is-the-format-of-attachments-in-XAR-t... Sent from the XWiki- Users mailing list archive at Nabble.com. _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
-- Jean Simard [email protected] Research engineer at XWiki SAS http://www.xwiki.com Committer on the XWiki.org project http://www.xwiki.org
I just added more details about the attachment on http://extensions.xwiki.org/xwiki/bin/view/Extension/XAR+Module+Specificatio.... That being said if you are in Java one way to not have to care about that is to use the XWiki Filter module to parse the XAR since you don't need a running instance of XWiki to use it. You can see what the standard XAR parser does with attachments on https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwik.... On Wed, Apr 27, 2016 at 9:57 AM, Jean SIMARD <[email protected]> wrote:
Hi,
It's a Base64 encoding so you should be able to use on Linux any base64 decoder. For example, on Linux (I guess on Mac it must be similar), you can do
cat your-content.txt | base64 -d
or shorter
base64 -d your-content.txt
I hope this helps,
Sincerely,
On 27/04/2016 08:33, xrichard wrote:
Hi,
I'm trying to retrieve attachments stored in a XAR export file.
According to documentation (see http://extensions.xwiki.org/xwiki/bin/view/Extension/XAR+Module+Specificatio...) XML node <attachment> contains everything I need to get files content but how is encoded and how to decode the node <content> ?
Thanks for your answers, best regards,
-- View this message in context: http://xwiki.475771.n2.nabble.com/What-is-the-format-of-attachments-in-XAR-t... Sent from the XWiki- Users mailing list archive at Nabble.com. _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
-- Jean Simard [email protected] Research engineer at XWiki SAS http://www.xwiki.com Committer on the XWiki.org project http://www.xwiki.org _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
-- Thomas Mortagne
Thanks for your answers and documentation update, I'm now able to decode attachments stored in XAR file. -- View this message in context: http://xwiki.475771.n2.nabble.com/What-is-the-format-of-attachments-in-XAR-t... Sent from the XWiki- Users mailing list archive at Nabble.com.
participants (3)
-
Jean SIMARD -
Thomas Mortagne -
xrichard