I know unity webplayer cannot read local files. Am well aware. I am not just trying to access local files for a standard web game.
I've written an application that uses Unity Web Plugin as a component in an enterprise application for a company. The Unity Web Plugin is being loaded into another application through the use of a embedded web browser. So the .unity3d file and the .html file are actually stored on the local users computer.
I need to read files from the local users computer. I know I must use a workaround and Unity cannot do it directly. So I am just wondering if anyone has any suggestions about how to do this.
You could access the filesystem via the embedded web browser, then feed the content to Unity. See:
Exactly how you do it from the embedded browser will depend on it's details.
I havent tested this, but I believe you might be able to use a real path instead of an URL.
So ifs its in Windows it could be C:myapplicationstart.html and c:myapplicationapp.unity3d
As you mention, the security in a webbrowser prevents this sort of action from a website, but if you are running the HTML file from the local harddrive, it might be okay to read and perhaps even write on the same "localhost".
Havent tried it though, but interesting indeed.
Please post your findings too. :-)
answered Aug 24 '11 at 09:14 PM