react-native-fs icon indicating copy to clipboard operation
react-native-fs copied to clipboard

Error write file: No content provider when file name has a colon punctuation mark.

Open vatto1337 opened this issue 5 years ago • 3 comments

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'

vatto1337 avatar Aug 03 '20 12:08 vatto1337

im having similar issue

louisobasohan avatar Oct 02 '20 14:10 louisobasohan

im having similar issue

I gave up in the end. Simply don't use ":" in file names.

vatto1337 avatar Oct 05 '20 07:10 vatto1337

convert timestamp using javascript date.toString() method.

DhruvikLadWappzo avatar Sep 22 '22 05:09 DhruvikLadWappzo

UN RESOLVED ISSUE

codetobuild avatar May 03 '24 10:05 codetobuild

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

marifuli avatar Jun 28 '24 13:06 marifuli