def documents_upload(ctx, max_threads, files):
    """Upload a document file (of any type) to One Codex"""
    if len(files) == 0:
        click.echo(ctx.get_help())
        return

    files = list(files)

    bar = click.progressbar(length=sum([_file_size(x) for x in files]), label="Uploading... ")
    run_via_threadpool(
        ctx.obj["API"].Documents.upload,
        files,
        {"progressbar": bar},
        max_threads=max_threads,
        graceful_exit=False,
    )