Opening File from File Explorer (no plugins)

Trying to use the OpenFileDialog (or any other build in functionality) to open a file dialogue and then read in file contents. The reading in of the file works. However, when I use this dialog function, the file path that results is relative, containing “../../../../../../”, and this seems to not work for the Open function I have. Can someone help me either:

  1. Find a way to use this OpenFileDialog function (or if there is another system I can use)
  2. Fix the resulting path to not be relative
  3. Or if there is just an issue in this code, let me know

Hey there, I suggest using the FPaths::ConvertRelativePathToFull function on the output.

the relative path is normal, that dialog returns a path relative to the project and your file open expects an absolute one. run the result through FPaths::ConvertRelativePathToFull first and teh ../../ bits resolve away.

longer term, keep the picker and the loader as separate steps. picker returns a path string, loader turns it into data, so a path format change only touches one place.

you can also try Async Runtime File Dialog, a native file picker plugin for Unreal Engine that returns an absolute path from an async open dialog in packaged builds: Async Runtime File Dialog — Native OS File Picker for Blueprints | Fab