Closed tomaszzackiewicz closed 7 years ago
Hi,
SaveFilePanel returns selected path, you can use System.IO.Path.GetFileNameWithoutExtension(path) to get entered filename
How to use Application.persistentDataPath in your FileDialogs?
If you want to open PersistentDataPath as initial directory of dialog, you can pass İt to "directory" parameter.
Ok, thank you. I understand.
I can get the file name in SaveFileDialog with System.IO.Path.GetFileNameWithoutExtension(path), but it doesn't work with OpenFileDialog. OpenFilePanel returns a string array. How to grab the file name to open it in my serializer code?
You right, since OpenFileDialog supports multiple file selection, it returns an array of paths. If user selects one file you can get file path from first index. Like:
var paths = StandaloneFileBrowser.Open(... string path = paths[0];
Ah, it's the first path in the array! Now, it's clear.
Thank you very much for your help!
All the best!
You're welcome.
Hi,
It's not an issue because your code works great, but a question. I need to get the file name I write in the File Dialog to use it in a binary serlialization code. I have your code and the serialization code and now I need to join them into one piece of code. How to do that?