Closed
Description
Hi.
I'm trying to upload a large file. My application crashes after launching the upload with the error:
- Terminating app due to uncaught exception 'NSMallocException', reason: 'Failed to grow buffer'
On a small file size works well.
iPad Pro
Deployment Target : 12.1
React-Native v0.58
Code:
const upload = new tus.Upload({ uri:
`${RNFS.DocumentDirectoryPath}/images/${item.image}`}, {
endpoint: 'http://192.168.1.5:1080/files/',
retryDelays: [0, 1000, 3000, 5000, 10000, 15000, 20000],
resume: true,
metadata: {
name: item.image,
filetype: item.image.substring(item.image.lastIndexOf('.') + 1).toUpperCase(),
copyright: 30
},
onError: (error) => {
console.log('Error upload:', error)
},
onProgress: (uploadedBytes, totalBytes) => {
console.log(`Progress: ${uploadedBytes / totalBytes}%`)
},
onSuccess: () => {
console.log('Upload URL:', upload.url)
}
})
upload.start()