I have an e2e testing environment where I upload to tus from tus-js-client. I see in the tus-js-client code where the total size is determined from options.uploadSize
so I tried overwriting it:
const file = Buffer.from('hello world');
file.type = 'text/plain'
const upload = new tus.Upload(
file, // contents of file to be uploaded
{
endpoint: config.tusUrl, // ex: https://tus.url.com/files/
},
);
upload.options.uploadSize = 10000;
upload.start();
Setting the uploadSize
to something higher than the actual file size does result in a constant stream of tus PATCH
requests with length 0