AnsweredAssumed Answered

CMIS Issue in Uploading Microsoft Documents.

Question asked by suvaraj on Feb 25, 2009
Hi,
I am trying to upload Upload documents like Word,Excel.But CMIS creates the documents of 0 byte size.

The mimetype of any file(png, jpeg, excel, etc) uploaded through the CMIS API is considered as application/octet stream. How to i change the mime type.

Below is the sample code which I have used to upload the Excel.
———————————————————————————————————————————————————————–
DataSource graphImageDataSource = new FileDataSource("D:\\Documents and Settings\\All Users\\Documents\\" + "SampleExcel.xls");
// Create the dataHandler out of the above created datasource
DataHandler graphImageDataHandler = new DataHandler(graphImageDataSource, "application/vnd.ms-excel");
System.err.println("1111111111 graphImageDataHandler.getContentType():::: "+graphImageDataHandler.getContentType());
CmisContentStreamType cmisStream = new CmisContentStreamType();
cmisStream.setFilename(graphImageDataSource.getName());

cmisStream.setMimeType("application/vnd.ms-excel");
//cmisStream.setMimeType(MimetypeMap.MIMETYPE_PPT);
//cmisStream.setMimeType(MimetypeMap.MIMETYPE_EXCEL);
cmisStream.setStream(graphImageDataHandler);
———————————————————————————————————————————————————————–
Please let me know what I am missing out.

I have to resolve it as soon as possible.

Outcomes