def _upload(project, subject, session, scan, dcm_dir, volume_files,
    time_series=None):
    """
    Uploads the staged files.

    :param project: the project name
    :param subject: the subject name
    :param session: the session name
    :param scan: the scan number
    :param dcm_dir: the input staged directory
    :param volume_files: the 3D scan volume files
    :param time_series: the 4D scan time series file, if the scan is
        multi-volume
    """
    from qipipe.pipeline.staging import upload_dicom, upload_nifti
    upload_dicom(project, subject, session, scan, dcm_dir)
    if time_series:
        nii_files = volume_files + [time_series]
    else:
        nii_files = volume_files
    upload_nifti(project, subject, session, scan, nii_files)
