UnityStandaloneFileBrowser
UnityStandaloneFileBrowser copied to clipboard
Full path on WebGL
Hi, when I use this plugin to select a file on my computer on WebGL build, the "OnFileUpload(string url)" method returns url like "http://localhost:8080/b9d3a922-816f-4a4c-9004-c1aa5e449380". Can I get the actual path of the selected file like"D:/xxx.xxx"? Thanks!
Hi,
No, you can’t. Due to security reasons, browsers not allowed to read file system.
Hi,
No, you can’t. Due to security reasons, browsers not allowed to read file system.
Thank you for your reply, and what about the name? Is there a method I could get the name of the file selected? I'm using this plugin to upload file, but before that, I should make sure the file's name is different from my project. Hope I expressed clearly.
I think its possible, on StandaloneFileBrowser.jslib line 44, you can get file name with event.target.files[0].name (or multiple name if you support multiselect)
But sending name to unity side is trickier since unity’s SendMessage only supports one argument you have to concat urls and names and differentiate them on unity side.
Sorry for replying late. Yes, it worked! And great thanks to you!
Hi @FanEric did you get selected file name on webGL? I'm really stuck on it if you can help?