i’m just trying out tweaking a the code from a tutorial to download files with expo-file-system and expo-sharing and i’m encountering this error.
Full error is:
Failed to create storage directory.Error Domain=NSCocoaErrorDomain Code=512 “The file “my-app” couldn’t be saved in the folder “@user”.” UserInfo={NSFilePath=/var/mobile/Containers/Data/Application/C54DC1D3-033B-41DC-89D3-4541119F717D/Documents/ExponentExperienceData/@user/my-app, NSUnderlyingError=0x3017c0390 {Error Domain=NSPOSIXErrorDomain Code=20 “Not a directory”}}
The error comes from calling this snippet which is in a useEffect:
createDownloadResumable(
'https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf',
documentDirectory + 'dummy.pdf',
{},
callback
);
then i download it and save the file in my storage using expo-sharing with shareAsync(documentDirectory+'dummy.pdf');
It worked well the first few times i tested it and tweaked it, and when i was fiddling around, i deleted the folder created by expo-sharing with shareAsync(documentDirectory+'dummy.pdf');
. I assumed that was the problem so i restored the folder in my iphone but the error still persists.
If that’s not the issue what is causing this? someone please help?
Jordy Robson is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.