VR - camera - save jpg

Good day to all!
How can you take a screenshot of what the user sees in the VR helmet at a given time (or, for example, a virtual camera that can be taken by the controller) and then save it to the hard disk
as a jpg file.
Perhaps there is a ready-made solution, but I do not know where to get it.

Internet search usually works well with those things:

https://answers.unrealengine.com/questions/180407/taking-a-screenshot-through-a-camera.html