- Home /
Question by
vanshika1012 · Nov 13, 2014 at 07:00 AM ·
imageserverencodetopng
Base64 encoding always show white image on device.
Hi,
I want to send my clicked image to server. My code is working fine on editor but when I run on device it always show me white image. Here is my code.
form = new WWWForm();
if UNITY_EDITOR
if (cameraController.snap == null)
cameraController.snap = toySnap.mainTexture as Texture2D;
endif
byte[] bytes = cameraController.snap.EncodeToPNG();
string encodedText = Convert.ToBase64String (bytes);
form.AddField("image",encodedText);
www = new WWW(posturl , form);
StartCoroutine(recieveResponse(www));
toySnap.mainTexture = cameraController.snap;
it showing image clicked on toySnap texture. Moreover I am getting two errors: You are trying to load data from a www stream which had the following error when downloading. java.net.MalformedURLException: Protocol not found:
Comment
Your answer
Follow this Question
Related Questions
How to grab POST image data from WWWForm on server? 1 Answer
Download images from server and storing it in Resources. 1 Answer
Qos type ReliableFragmented channel, won't fragment our stream 2 Answers
Unity networking tutorial? 6 Answers
A good way to save an image in Unity webplayer and send it to a server? 2 Answers