We have an application that used to launch an instance of MS Word to manipulate a document and then sends that to FileNet. We recently replaced the part that launches MS Word and now we are using0 Aspose.Words to manipulate the document and save it locally before we send it to FileNet in the same way as before. We found out that with the new way, the documents uploaded to FileNet get a mime type of application/octet-stream while previously it used to get a mime type of application/msword. I’ve tried to set the save format and the content type properties in aspose before saving the document but that didn’t fix the issue. Any help would be much appreciated.
@romanythomas Could you please specify in which format you save the output document and provide a code you use to upload the document to FileNet? We will check the issue and provide you more information.
application/msword
type is used for .DOC format. You can check content type of the saved document by checking SaveOutputParameters returned by Document.Save
method.
Thanks @alexey.noskov for your response. I’m saving the document as .DOC. Here is the code used to save the document and upload to FileNet
Dim strDocName As String
Dim oNewdocument As New IDMObjects.Document
strDocName = AuditNiteCrewLettersTempFolderPath + "workNCdoc.doc"
wordDocument.BuiltInDocumentProperties.ContentType = "application/msword"
wordDocument.Save(strDocName, SaveFormat.Doc)
oNewdocument = CType(oCurrentLibrary.CreateObject(IDMObjects.idmObjectType.idmObjTypeDocument, "Claims"), IDMObjects.Document)
'oNewdocument.Properties("ClaimNum").Value = myClaim
oNewdocument.Properties.Item("OrigRcptDate").Value = Now.ToShortDateString
oNewdocument.Properties.Item("DocStatus").Value = "CREATED"
oNewdocument.SaveNew(strDocName)
@romanythomas Thank you for additional information. Unfortunately, I do not have experience with FileNet, but I believe there should be a property for setting mime-type of the uploaded content explicitly.
https://www.ibm.com/docs/en/filenet-p8-platform/5.2.1?topic=properties-contenttype-property
As for .DOC file produced by Aspose.Words it is a valid .DOC document and must be detected. Most likely FileNet has some bug in file type detection algorithm.