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

    UploadItem contentType via javax.activation

    nimo stephan Master

      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 ?