Revert "Abandon streaming, use a temporary file instead"

This reverts commit 23a651198af311299c751b81cf989b0cb59e03c8.