- Home /
How to load a local texture file to WebPlayer
From I have learnt so far the only way to load a file from the local computer to the WebPlayer involves sending this file to server, generating an event, getting this event inside WebPlayer, and importing the file from the server to WebPlayer. In this way the data travels to the server and then back to the computer if I am right. There is no way to bypass this, is it?
Basically I want to let the user to see a GameObject mapped with his own file.
It is possible to pass a file to the WebPlayer as an argument of unity.SendMessage function in javascript on the webpage?
Answer by DavidDebnar · Jul 08, 2011 at 07:53 AM
I don't think so...best way to get some file into webplayer is using the WWW...I wanted to do the same, but i don't think its possible :|.
David
I did not expect any other answer; I asked the question just to make sure, but is not easy to accept that the data has to travel twice forth and back.
Yep it's sad...$$anonymous$$y 3D artist wanted me to make a program for him, that would import his 3d file and that he could rotate it. But the only way is to upload it. BUT..I got and idea...You could use something like Dropbox, than place the file to the Public folder, copy the public link, and than just make a GUI TextArea or what is it called, let the user write the link to it and that just download the link using the WWW and apply it to the object.
$$anonymous$$
Oh, well you have already done this so you are deeper into details. But myself I don't want to make user to manually write anything into GUI.TextArea, but I want to use the html form.
Finally I have managed that through the WWW and it can be seen here: http://virtualplayground.d2.pl/Unity/scianka2x3/popup.html
Wow, that's impressive. Would it be possible to see how you accomplished this? Is there any more information about it on your website, because I couldn't find it.
Answer by DaveA · Jul 08, 2011 at 02:15 PM
You might be able to embed the form in your player (using WWWForm) You might also consider building it as stand-alone. They'd have to install it (no biggie) and you can still use WWW to talk to servers.
Answer by Graham-Dunnett · Oct 24, 2011 at 01:35 PM
Note that the webplayer has no access to the hard drive of the client machine. The excellent example from tomekkie2 has the html page access the file and push it into the webplayer using SendMessage. Great work!