victorsoares96 / epubjs-react-native

ePub.js Reader for React Native
MIT License
151 stars 50 forks source link

base64 - big epub files problem #84

Open veeyka opened 1 year ago

veeyka commented 1 year ago

hi . when i open a epub files which is more than 200KB with base64 on localstorage it throws an erro . Error: Couldn't download book what can i do for epub files with 5 or 6 MB or larger . thanks

kravchenko-anton commented 1 year ago

Not save file in local storage, save to local devices. Check my project(booknex) where I create this functionality

veeyka commented 1 year ago

hi dude . thanks for respond . in saving to this location . its my destination. fs.DocumentDirectoryPath+"/epub/epub2.epub"

i saved file in DocumentDirectoryPath with react-native-fs . and i read file with this code . RNFetchBlob.fs.readFile(RNFetchBlob.fs.dirs.DocumentDir+"/epub/epub2.epub","base64").then(data=> with rn-fetch-blob could you please tell me more about this . sorry im new and i dont know where is local devices .

github-actions[bot] commented 7 months ago

This issue is stale because it has been open for 90 days with no activity.

aliMurtaja commented 1 day ago

I am having same problem, I did this

function onPressLearnMore() {

RNFS.readFile(RNFS.ExternalStorageDirectoryPath+ "/clinic/example.epub" , 'base64').then((res)=>{
  console.log(`FILE WRITTEN! ${res}`)
  setBasesf(res)
}).catch(err=> console.log(err))

}

But didn't work