ReactNativeBlobUtil crashes on Android with large files when getting base64

95 views Asked by At

I am trying to get pdf's base64 to save it to my client's local device, and I do the following;

        ReactNativeBlobUtil.config({
          fileCache: false,
        })
          .fetch('GET', response?.data?.url)
          .then(async bookResponse => {

            const content = await bookResponse.base64(); //This line causes the crash
            //I am dividing the incoming content into 8MB Chunks, not relevant
            const splittedContent = splitBase64IntoChunks(content);
             ...Rest of the code below
              });

In ios, it seems to work fine even large pdf files like 100mb, however android is crashing when trying to get a large file such as 40mb.

What am I doing wrong?

0

There are 0 answers