dirkmoors / drf-tus

A Tus (tus.io) library for Django Rest Framework
MIT License
24 stars 26 forks source link

Uploading Fail while uploading from android-tus-client. #15

Closed c0d33py closed 1 year ago

c0d33py commented 1 year ago

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"
dirkmoors commented 1 year ago

Hi @c0d33py, it's been a while since I've looked at this repo. Could it be that you're not providing the "Content-Length" header with the android-tus-client? Also, the "100-continue" message is something I do not recognize; it was not part of the TUS protocol at the time I was implementing this. If I find some time in the future, I might look into this further. Until then, if you feel up to it, please provide a pull request to solve the incompatibility.

dirkmoors commented 1 year ago

Closing for now, until reopened