Hi,
This should generally work.
Here is a typical Groovy script we often use to add attachments from
File Uploads
We call it this way for example:
#set($doctitle = $xwiki.getUniquePageName(Space, title))
#set($newdoc = $xwiki.getDocument(Space.${doctitle}))
## attach files if
I'm executing some code on Save which attaches a PNG file to a document
that was edited/saved.
When I call docObj.saveAttachmentContent(attP, context); the attachment
is save OK but any changes made to my document (ie. text changes) are
not saved.
If I comment out this line the text changes are