Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X
Hi.
I have data presented by outputstream or byte array (data contains excel file).
How can i replace primary content of WTDocument by this new file?
Should i use ContentServerHelper.service.updatePrimary method? How to create ApplicationData instance from my data?
Thanks.
I am using this code now:
ContentHolder refreshedContentHolder = ContentHelper.service.getContents(document);
ContentItem contentItem = ContentHelper.getPrimary((FormatContentHolder) refreshedContentHolder);
ContentHolderHelper.deleteContents(document, contentItem);
ContentHolderHelper.setContents(document, byteArray, ContentRoleType.PRIMARY, "name", "", false);