Hi All,
I’m facing very strange problem with WWW request.
For some reason my request Upload file API is returning garbage value “�\b” all of sudden.(check screenshot for more details)
I also tries the same with UnityWebRequest but its still the same problem.
Most interesting this is that the build were working without any problem but for some reason its not working anymore. Also another interesting fact the same code is working perfectly on Mac.
I’m attaching the dummy project for your reference.
your help is highly appreciated.
Regards,
ABGamerss

2953423–219069–FileUploadTest.zip (1.47 MB)
What is actually returned by server?
Expected return value is
{“status”:“success”,“filesize”:172153,“fileurl”:“http://teja3.kuikr.com/cf1/20170209/jpg/ak_1082016005-1486651958.jpg”,“filename”:“20170209/jpg/ak_1082016005-1486651958.jpg”}
@Aurimas-Cernius
I though this might be unity latest version issue but its giving problem too older version of unity as well.
I also downloaded the other plugin which pas posting data using their API even in that plugin we are getting the same garbage value.
But Postman is showing the correct output as mentioned above
Sounds like a bug. Can you report it?
I have raised the Bug request!!
The problem is that the builds(.exe) which were created previously and were working fine are also not working anymore
I’m not sure how its effecting old applications which were working perfectly and are not at all changed for months are also not working.
does this means application / Games build using unity & having such feature will also get effected??
We need to figure out what the problem is. I.e. it could be some change on server side.
any idea what type of server side setting could cause this type of problem?
Try using Fiddler on Windows to monitor network traffic. See how server response looks like.
hi it seems the response is in gzip format. and for some reason its unable to uncompressed itself in windows.
is there any such limitation in windows builds?
Yes, there is, but that should only be the case if you explicitly request gzip compression by setting Accept-Encoding header. Do you set that header? Also check that header in request in Fiddler.
I cross verified there is Accept-Encoding header but exact same setting i present on our staging server & there its working for windows system.
On Staging Server Its working Fine on windows ( Postman screenshot )

On Production Server Its not working( Postman screenshot )

Note on post man its working but not in actual code
Hi to fix this issue we had to remove the gzip encoding from the API server.
Now the server is “Content-Encoding” value is set to “identity”
this automatically removed
Vary from header.
Check the image below for more info.
What I meant was whether you set Accept-Encoding header in Unity code or do you leave it for Unity?
If this header is not set by your code, Unity should automatically set it to the correct value. If it sets it to gzip on platforms where it does not support gzip, it’s a bug.