Open and read a file selected by a user dialog.