def file_upload(context, id, name, path, jobstate_id, test_id, mime):
    """file_upload(context, id, path)

    Upload a file in a job

    >>> dcictl job-upload-file [OPTIONS]

    :param string id: ID of the job to attach file to [required]
    :param string name: Name of the file [required]
    :param string path: Path to the file to upload [required]
    :param string jobstate_id: ID of the jobstate to attach the file
    :param string test_id: ID of the test if the file is a test result
    :param string mime: The mime type of the file
    """
    result = dci_file.create_with_stream(context,
                                         name=name,
                                         job_id=id,
                                         file_path=path,
                                         jobstate_id=jobstate_id,
                                         test_id=test_id,
                                         mime=mime)
    utils.format_output(result, context.format)