AnsweredAssumed Answered

Hi, I've trying to upload multiple documents from file system for that I've been using following code:-

Question asked by achatterji on Apr 26, 2018

File file1 = new File(nonXmlFilePath);//nonXmlFilePath:- e.g. C:\\Migration\\CDM\\321YZ9B_04DWTBPR9000B1Q\\321YZ9B_04DWTBPR9000B1V.txt

byte[] b = FileUtils.readFileToByteArray(file1);

ByteArrayInputStream input = new ByteArrayInputStream(b);

String mimetype ="application/octet-stream";
contentStream = session.getObjectFactory().createContentStream(nonXmlFileName,b.length,mimetype,input);

fold.createDocument(newDocumentProps, contentStream, VersioningState.MAJOR);//fold is an Folder object


Now with that above given code the file with special characters like Spanish character are not interpreting correctly. instead character it's writing ?. the string which is actually in the file is:- Lexmark Relatório Mensal_Fevereiro 2015.

Apart from that the upload is not taking place for all files,  some random files are not getting uploaded and throwing error:- 

CmisStorageException: Expected XXXXXX bytes but retrieved 0 bytes!

Please help in this regards.