Unity to PHP to XML / Upgrade issues
0 down vote favorite I had a Windows app developped with Unity that would use a XML file as a Database. To write on this file, I have a simple PHP file on a server where the XML is.
To summarize, it looks like this :
<?php
$testFile = fopen('testPhpAcceded', 'w');
if ($_POST)
{
if ($_FILES['file']['error'] === UPLOAD_ERR_OK)
{
DO THE THING
} else {
$testFile2 = fopen('testPostError.xml', 'w');
}
} else {
$testFile3 = fopen('testNoPost.xml', 'w');
}
So I'm able to Debug. (PHP NEWBIE). It worked for a while but now that I upgraded server, it doesnt anymore.
At the time, I was using Unity WWW class with FORM to pass on the XML file.
Now I tried with the UnityWebRequest to use the same form but the result is always "NO POST".
I tried a lot of things (chunked transfer, HTTPS, Post_Data_reading is true)
The C# is as simple as it can be :
using (UnityWebRequest w3 = UnityWebRequest.Post(url, form))
{
w3.chunkedTransfer = false;
yield return w3.SendWebRequest();
if (w3.isNetworkError || w3.isHttpError)
{
Debug.Log(w3.error);
}
else
{
Debug.Log("Form upload complete!");
}
}
App is Windows Standalone Server's PHP is now 7.2, uses to be 5.6
Thank you guys for reading me, not a native English, hope it's understandable.
Your answer
Follow this Question
Related Questions
Login cookies 2 Answers
WWW class and UnityWebRequest no longer working in Unity 2017.3.0 5 Answers
HTTP GET Method in C# Unity 3D - How to target specific text or header 1 Answer
Establish a constant connection to a web server 0 Answers
[ASP.NET] [WEB API] Problem with HttpWebRequest.ContentType 0 Answers