统一到PHP到XML /升级问题

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.

dtkyayvldeaqhl7151
dtkyayvldeaqhl7151 嗨,大家好,我只是从UNUN中复制了这个位并添加了chunktransfert部分。我创建表单的部分是原样和工作的。(我用C#编辑了这个问题。谢谢
2 年多之前 回复
doutao6653
doutao6653 你说你试过“chunkedtransfer”。我有很多问题花了我很长时间才弄明白,最后通过将chunckedtransfer设置为FALSE来解决它。你试过吗?此外,如果您发布c#代码也会有所帮助
2 年多之前 回复
douchun3680
douchun3680 你是否正确地将UnityWebRequest的方法属性设置为POST?
2 年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐