code: private byte[] getUploadFileContent(RequestElements requestElements) throws FMSException {
  		Attachable attachable = (Attachable) requestElements.getEntity();
  		InputStream docContent = requestElements.getUploadRequestElements().getDocContent();
  		
  		// gets the mime value form the filename
  		String mime = getMime(attachable.getFileName(), ".");
  		// if null then gets the mime value from content-type of the file
  		mime = (mime != null) ? mime : getMime(attachable.getContentType(), "/");
  		if (isImageType(mime)) {
  			return getImageContent(docContent, mime);
  		} else {
  			return getContent(docContent);
  		}
  	}
docs: Method to get the file content of the upload file based on the mime type
  
  @param requestElements the request elements
  @return byte[] the upload file content
  @throws FMSException