code: public void upload(final String uri, final File sourceFile, final String contentType)
              throws IOException, AppPlatformException {
          final String path = getPath(uri);
          final HttpPut request = (HttpPut) setupRequest(path, HttpPut.METHOD_NAME, null);
          request.setEntity(contentType == null ? new FileEntity(sourceFile) : new FileEntity(sourceFile, ContentType.parse(contentType)));
          performRequest(request);
      }
docs: Convenience method to upload files to the server. User to upload media.
  
  @param uri the URI
  @param sourceFile the source file
  @param contentType the content type.
  @throws IOException unexpected exception.
  @throws AppPlatformException unexpected exception.