Android-tus-client getting error with django-tus and drf-tus API's

I am using drf-tus server in django. i am getting keyError while uploading from android-tus-client on the oherehand tus-js-client is working fine. I don’t understand why am getting this error because the drf-tus and django-tus is working fine with tus-js-client except android-tus-client. Please help me out.

What is the exact error? Please elaborate. Could you also share your code for uploading on Android?

  • Django version: 3.2
  • Python version: 3.10
  • Operating System: Linux

Description
I am using drf-tus in django. i am getting KeyError while uploading from android-tus-client on the on the other hand tus-js-client is working fine. I don’t understand why am getting this error because the drf-tus is working fine with tus-js-client except android-tus-client.

I have try to upload files using android-client and tus-js-client they both are working fine with tusd server, but when is try to upload file using drf-tus in django the android-client is getting keyError on get_chuck() because the android-client is sending Transfer-Encoding": "chunked" and chuck data is b"" header on the other hand the js-client is working only

I want to upload file from android and js-clients as well but android is not working for me. Please help me on it.

DRF_tus partial_update print header is while uploading from tus-js-client

    "Content-Length": "152944",
    "Content-Type": "application/offset+octet-stream",
    "Connection": "keep-alive",
    "Tus-Resumable": "1.0.0",
    "Upload-Offset": "0"

DRF_tus partial_update print header is while uploading from android-tus-client

    "Content-Length": "",
    "Content-Type": "application/offset+octet-stream",
    "Tus-Resumable": "1.0.0",
    "Upload-Offset": "0",
    "Expect": "100-continue",
    "Transfer-Encoding": "chunked"

As far as I understand it, your server (drf-tus) does not support chunked transfer encoding properly, but tus-java-client, which powers tus-android-client requires this support. There has been an attempt to make this requirement optional in tus-java-client (https://github.com/tus/tus-java-client/pull/32), but it has not been merged unfortunately. We have plans to rework tus-java-client’s HTTP client, which would likely solve this issue, but there is not ETA available right now.

I would recommend you to use another tus sever, which properly supports chunked transfer encoding, such as tusd. I hope this helps, although it might not be entirely satisfying.