- Home /
Unity export project for Android, WebService error while uploading data
I'm exporting a project from Unity3D for Android,
I'm trying to upload data to a WebService
In Unity3D, it's working without any problems. Here's my code.
IEnumerator CreatHuman_UploadData(string Base64)
{
WWWForm form = new WWWForm();
form.AddField("uid", guid);
form.AddField("file", Base64);
WWW www = new WWW(url, form);
yield return www;
if (www.error != null)
{
Debug.Log("Upload Error: " + www.error);
}
else
{
Debug.Log("Form upload complete!");
}
}
Blockquote
But when I Export Project for Android, it gives me an error.
It prints this Upload Error: 500 Internal Server Error
If I'm not wrong, there should be an Android-specific command for uploading the data for Android as the problem is only on Android, not in Unity3D. But I don't seem to find that Android-specific method.
Thanks for your help.
PS: "guid" and "Base64" is a string
$$anonymous$$ight be your www thing, as it's obsolete for like 2 yrs now. Check this webRequest
Answer by Marioooo · Jan 15, 2020 at 01:48 PM
Hi. As you can see you've a 500 error. This means that the server you're pointing at has some trouble processing the data that you sent. So, can you perform a debug on backend? Maybe some of your strings are wrong and that leads to a 500 error. Or there's some bug on backend and that's why 500 happens.
Hope this helps!
Hi @$$anonymous$$arioooo... Thank you for pointing me in the exact direction.
I solved the problem by correcting the data format I was sending to the server.
Your answer

Follow this Question
Related Questions
How to Upload a video from Android/iOS to a server without using WWW ? 3 Answers
UnityWebRequest and/or HttpWebRequest gives 403 on PUT 0 Answers
Uploading file on Android 2 Answers
How upload file to host (php and unity) 0 Answers
Webservices on android 0 Answers