AnsweredAssumed Answered

How to set content type while uploading in to alfresco?

Question asked by shibu on Apr 1, 2013
Latest reply on Apr 2, 2013 by shibu
I am trying to upload files in to alfresco using API. Creating an xml input to the API.
Mime type is setting like,

            Collection<MimeType> mimeTypes = MimeUtil.getMimeTypes(file);
       MimeType mimeType = MimeUtil.getMostSpecificMimeType(mimeTypes);
       if(mimeType == null) mimeType = MimeUtil2.UNKNOWN_MIME_TYPE; 

and using "mimeType.toString()" to set the content type.  As it is giving "application/octet-stream" mimetype for most of the files, the mime type is not setting exactly while uploading.

How can I solve it?

Outcomes