6 Replies Latest reply on Jul 26, 2010 4:24 AM by ilya_shaikovsky

    UploadItem contentType via javax.activation

    nimo22

      A UploadItem retrieved via rich:fileUpload has the method "getContentType" which always returns "application/octet-stream".

      uploadItem.getContentType() returns "application/octet-stream"


      When using explicitly the the "javax.activation-framework" to determine the specified content-type of my uploadItem, I also get "application/octet-stream", which is definitly not true:

      String contentType= new MimetypesFileTypeMap().getContentType(uploadItem.getFile().getName());
      String contentType2= new MimetypesFileTypeMap().getContentType(i.getFile());


      contentType should, in this case, returns "audio/mpeg" and not "application/octet-stream".

      How can I determine the specified content-type of my UploadItem ?