Gain access to a file provided by the user?

Hi!

I’m currently building an application that caters to input given by the user. We want the input to be in the form of a file (eg a text file). We will parse the file that they give us and create an environment based on that.

I was wondering how this could be accomplished. is there any way for the user to specify a file path during run time for us to read in? Could the user put the file into a specific, designated folder with a specific name and we’ll know to grab it when they launch the program? What would be the best way to go about this? Is it possible for them to upload during runtime?

Thanks in advance!

It certainly is possible to read a file from the disk using C++ and act on that. It’s easier if you have a predefined location so you don’t have to have the whole “browse” GUI to do.

Another option is a widget where they can paste the text. It can be all done with blueprints in that case.

The C++ to read a file is not hard though, UE4 C++ API has a read text from file function. Full details here

Hope this helps :slight_smile: