[xwiki-users] How to add attachments ?
Hi, how to add attachments using one of 2 methods: addAttachments(java.lang.String fieldName) and addAttachment(java.lang.String fileName, java.io.InputStream iStream) of com.xpn.xwiki.api.Document class ? I tried using them but don't know the right way to use. Please give me an example using these 2 methods.
Hi, On Feb 25, 2008, at 5:16 PM, Ngo Thi Hong Nga wrote:
Hi, how to add attachments using one of 2 methods: addAttachments(java.lang.String fieldName) and addAttachment(java.lang.String fileName, java.io.InputStream iStream) of com.xpn.xwiki.api.Document class ? I tried using them but don't know the right way to use. Please give me an example using these 2 methods.
See http://code.xwiki.org/xwiki/bin/view/Snippets/MindmapSitemapSnippet It's in groovy but the same API applies for Velocity. -Vincent
Sorry for my keep asking but I really don't know what the value of argument "fieldName" in "addAttachments(fieldName)" is. Is it related to the value of file input ?? <form action="" enctype="multipart/form-data" method="post"> <input type="file" name="file"/>
Hi, anyone can help me with using the method "addAttachments(fieldName)" ? Please give me a small code snippet using this method if you have time.
The MindmapSitemapSnippet does not use the above method. I tried $doc.addAttachments("..") but I don't know what is the value for argument fieldName?
On Feb 26, 2008, at 5:14 PM, Ngo Thi Hong Nga wrote:
The MindmapSitemapSnippet does not use the above method.
Maybe but it does add an attachment and it works... Anyway you can check the source code if you want to know more since there's no documentation for these API yet. http://fisheye.xwiki.org Thanks -Vincent PS: Please keep the context when answering emails
I tried $doc.addAttachments("..") but I don't know what is the value for argument fieldName?
I viewed the XE core 1.1.2 source code but did not understand, so I post the question here :) Anyway, thank you.
participants (2)
-
Ngo Thi Hong Nga -
Vincent Massol