Loading image from local directories into webplayer fireFox3 probleme

Hii,
i want to let the user choose a picture on his local drives and load it into my unity app (webbrowser).
i managed to have it working on IExplorer(only on local), using a form to get the filepath.

but Online, with IE,FireWorks, Chrome, Opera… there is a lock that hide the complete file path…
i can only access the filename… not the fullpath filname.
so i can’t use www class to load my picture…

does anybody know a way to perform the image loading into my app ?
how can i get the corect fullpath to the user picture into my unityapp ?

thanks

the c# into unity:

IEnumerator updateURL(string newURL){
	Application.ExternalCall("console.log",newURL);
	WWW www = new WWW(newURL);
	yield return www;
	renderer.material.mainTexture = www.texture; 
		
}

the form to get the file name:

<form action="" method="get" name="updateUnityTexturePath">
<input name="filename" type="file" size="40" />
<input name="hop" type="button" onClick="updateUnityTexture(filename.value)" value="hop" />

</form>

the javascript to call update into unityapp:

<script type="text/javascript" language="javascript">
		<!--
		function updateUnityTexture(path)
		{
			var unity = GetUnity();
			if (unity){
				alert("the path: " + path);
				unity.SendMessage("wwwObj", "updateURL", path);
			} else {
				alert("Error no Unity");
			}						
		}
		-->
		</script>

to see the problem :http://www.mutsu.fr/wwwPlayer

Ehhhh, I’ve done it recently with a side-by-side Silverlight application which reads the image bytes and feeds those bytes to the Unity instance via JavaScript. It’s a bit of a convoluted method; perhaps there’s an easier way with pure JavaScript/form posting, but I’m not sure.

EDIT: also, this isn’t strictly a Firefox3 “problem”; this is a fundamental web-browser security restriction.

a webplayer can not access the harddisk, it’s not allowed in the new security model.

yes that what I have discovered… so…
how can i load a user picture into my unity web app. ?

(photoshopOnline can access user picture… how can i do the same?)

Short of using some server-side script (where the user uploads their picture onto the server), you’d probably have to use some other plugin that can read the bytes of a file that the user picks. Both Flash and Silverlight can read files that the user picks and can feed those to unity via a JavaScript call (provided you wrap the bytes as Base64 encoded strings)

Told you it was convoluted! I hope there’s an easier way.

No there is no easier way. But generally you have a webplayer game on a website and if you offer such personalization you would want some community to bind the user so uploading it there to get it from there should be rather “natural” actually

thank for your replies.

so i think i will use a huge php/MySql system to upload a temporary picture on my server then ask unity’s www to go and check for img. and delete when loaded (as i don’t want them to be persistent). but i’m not really good at php…

by the way…if some one have a super (and easy) solution… let me know.

thanks

If they’re temporary, you can skip the MySQL DB part by reading/writing them to the server’s file system instead.

EDIT: It’d be nice if in a future version of Unity, it adds the ability for the player to use standard open/save dialogue boxes to be able to read/write bytes in a secure fashion similar to how Flash and Silverlight implemented it. Perhaps something to suggest to the Unity development team.

I wouldn’t see that as temporary. I would always store the image as file in the file system and only store the reference to find it in the DB