Hi! I want to get the upload progress. The code below works fine with downloading files (see commentaries), but not with uploading files. The while-loop is entered once, without a second condition check. Neither the error part in the while-loop is entered nor the part after the while-loop. The co-routine seems to hang up at line 35. For your information: "Test1", "Test2", "Test3" and "Test5" is shown in the console. unity application: Code (CSharp): // works! // this.request = UnityWebRequest.Get(uri); this.request = UnityWebRequest.Put(uri, data); this.request.SendWebRequest(); Debug.Log("TEST1"); while (!this.request.isDone) { Debug.Log("TEST2"); // works! // this.progress = this.request.downloadProgress; this.progress = this.request.uploadProgress; Debug.Log("TEST3"); if (this.request.isNetworkError || this.request.isHttpError) { Debug.Log("TEST4"); this.requestRunning = false; Debug.LogWarning(requestName + " request error: " + this.request.error); this.DoRequestCallback(); yield break; } Debug.Log("TEST5"); yield return null; } Debug.Log("TEST6"); By the way: The server receives the data successfully. I'm using a tomcat server with Spring Boot. Currently the server only returns 0 (failed) or 1 (succeeded) as a byte array for internal use. Maybe there is additional data missing for a response? Any help? server side: Code (CSharp): @PutMapping("putFile") public byte[] putFile(@RequestBody byte[] data, HttpServletRequest request) Edit: I also tried to return a ResponseEntity on the server side - with the same result.
OK, i solved the yield problem (the game object was deleted to early...) Now the progress value is 0 or 1. Would be nice if i can get values between 0 and 1.
Have you checked this to make sure it's not just uploading everything in one shot? https://docs.unity3d.com/ScriptReference/Networking.UnityWebRequest-uploadedBytes.html