• Move a staged upload to its final public location and mark it complete. Ensures safe filenames, performs the move, and persists metadata. If persistence fails, the file is moved back to the staging area.

    Parameters

    • upload: FileInstance

      Upload revision to finalize

    • uploadsDir: string

      Destination directory for completed uploads

    Returns Promise<void>

    Nothing; resolves once the upload is finalized or rolled back