QubitProducts / gcs-browser-upload

Resumable chunked uploads to Google Cloud Storage from the browser

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

It doesn't resume upload after restoring internet connection,

aqib008 opened this issue · comments

It doesn't resume upload after restoring internet connection,
Lets say user select file 0f 100 mb, after 50 mb the internet connection gets lost, it raise an error of networkError but on restoring internet it doesn't resume that upload.

Here is my code:

const chunkSize = 262144 * 4;

 const uploadFile = async (
      file,
      url,
      id
    ) => {
      const upload = new Upload({
        id,
        url,
        file,
        chunkSize,
        onChunkUpload: (info) => {
         console.log(info)
        },
      });

      try {
        await upload.start();
      } catch (e) {
        console.log('Upload failed!', e);
      }
    };