Chunked upload with xhr

Started by akshaybabloo5 replies2,751 views
akshaybablooOriginal post
#1

Is it possible to upload data as chunks with XHRUpload? An example would be great.

kvzTransloadit team
#2

I think what you are looking for is tus, did you check that out?

akshaybabloo
#3

Tus has it’s own protocol and I can’t combine it with xhr. Or can I?

kvzTransloadit teamReplying to #3
#4

Right but tus-js-client works via xhr, so any reason you need a custom protocol vs picking one from off the shelve that’s seen a lot of usage/improvements?

akshaybabloo
#5

I am not going for a custom protocol. I have a Django backend but I am not sure if I can use tus-js with the one you guys have? Because with XHR it’s straight forward, just POST data to a URL and I am not use with tus.

kvzTransloadit teamReplying to #5
#6

If you just want an Xhr, you should use the Xhr plugin. That does what you describe.

If you want chunks, like you said earlier, for resumability or parallel/faster uploads, you’ll need to layer some protocol on top of Xhr that the server side understands. You can do this from scratch or use tus.io. There are python implementations that can handle tus uploads, see https://tus.io/implementations.html (flash & django).

Does that help?