Hi,I have been using Alfresco Labs 3 Full Setup for Document Management integrated with my application.Any file of Microsoft word or excel format gets uploaded into Alfresco repository.When i try to open it using Alfresco Web client, It opens properly.
However, when i try to open the uploaded file through my application, it gives me "unknown file format" error.I have debugged my application and realised that the content downloaded from alfresco is corrupted.
The byte array obtained contains corrupted data due to which i get the above error.The code for downloading is given below:
Store storeRef = new Store(Constants.WORKSPACE_STORE, "SpacesStore");
Content[] contentResultArr = WebServiceFactory.getContentService().read(
new Predicate(new Reference[] { new Reference(storeRef, nodeId, null) }, storeRef, null),
Constants.PROP_CONTENT);
Content content = contentResultArr[0];
InputStream outFileContent = ContentUtils.getContentAsInputStream(content);
byte [] contentByteArr = ContentUtils.convertToByteArray(outFileContent);
outFileContent.close();
Kindly help me out with this issue.