Uploading File in parts using XMLHttpRequest and auth digest

I have a couple ideas. What happens if you wait for the blob slice to be created before making the upload call?

const firstBlob = await new Promise(resolve => {
  newBlob.slice(0, 262144).onCreated(resolve)
});

// send request with blob

firstBlob.safeClose();

const secondBlob = await new Promise(resolve => {
  newBlob.slice(262144, 262144 * 2).onCreated(resolve)
});

// etc

It looks like the rn-fetch-blob package has a polyfill for XHR that considers the onCreated callback. If you use that XHR instead it could also work.

const XMLHttpRequest = RNFetchBlob.polyfill.XMLHttpRequest;

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)