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?