Error write file: No content provider when file name has a colon punctuation mark.
Hi, my file path was this: 2020-08-03T12:03:51.244Z.jpeg
When I've tried to execute this line of code
await RNFS.writeFile(filePath +/${temp_fileName}, base64Result, 'base64');
It would throw an error because of the ':' in the name.( 12: 03 ) What I had to do is this:
await RNFS.writeFile(filePath +/${temp_fileName}, base64Result, 'base64'); await RNFS.moveFile(filePath + /${temp_fileName}, filePath + /${fileName});
I had to write the file with an unix timestamp instead of Date().toISOString() and then rename it. Because when you move them, it's not throwing that error.
I'm running a simulator of android 10.
Error log:
Error: ENOENT: No content provider: /data/user/0/com.appName.app/files/8b1dd339-ed94-4bdf-b02e-9a6c3b6c044d/14fa52e2-967e-4e6c-8fde-06fe960b21d6/START/Mon Aug 03 2020 13:11:12 GMT+0100 (BST).png, open '/data/user/0/com.appName.app/files/8b1dd339-ed94-4bdf-b02e-9a6c3b6c044d/14fa52e2-967e-4e6c-8fde-06fe960b21d6/START/Mon Aug 03 2020 13:11:12 GMT+0100 (BST).png'
im having similar issue
im having similar issue
I gave up in the end. Simply don't use ":" in file names.
convert timestamp using javascript date.toString() method.
UN RESOLVED ISSUE
im having similar issue
I gave up in the end. Simply don't use ":" in file names.
thanks, it's weird but i gues i don't have a choice