Not sure if this is the correct place to ask, but I hope someone is able to tell me whats going on.
I’m trying to read a rather big file in chunks using FileReader (File selected from an field). Works fine on Android, but somehow on iOS the FileReader stops reading the chunks exactly after 60 seconds. The error I am seeing is WebkitBlobResource error 1. Makes me wonder if this is some kind of permission error or something else.
Sample code:
let file = <input type="file">
let chunkSizeToUse = (1024 * 1024) // 1 MB chunks
let offset = (0 - chunkSizeToUse)
let readInterval = setInterval(() => {
if(offset < file.size){
offset += chunkSizeToUse
let fileReader = new FileReader()
fileReader.onload = () => {
let arrayBuffer = fileReader.result
//further chunk processing
}
fileReader.onerror = (err) => {
console.log(err) // WebkitBlobResource error 1 exactly after 60 seconds of processing
}
fileReader.readAsArrayBuffer(file.slice(offset, (offset + chunkSizeToUse)))
}
else{
clearInterval(readInterval)
}
}, 100)