react native - RNFS File Disappears Before Upload on iOS After Encryption (Works on Android) - Stack Overflow

admin2025-04-17  2

I am working on a React Native application that:

  • Picks a file using react-native-document-picker.
  • Moves the file to persistent storage using react-native-fs (RNFS).
  • Encrypts the file using AES-256.
  • Uploads the encrypted file to a backend.
  • This setup works perfectly on Android, but on iOS (both simulator and real devices), the file "disappears" before uploading. Here’s what I observe:
File is picked successfully. ✅
File is moved to persistent storage (RNFS.DocumentDirectoryPath). ✅
File is encrypted successfully and stored with _encrypted suffix. ✅
Upload request is triggered. ✅
Suddenly, the encrypted file does not exist. ❌ "No such file" error.

logs from ios simulator
LOG  
转载请注明原文地址:http://anycun.com/QandA/1744836956a88305.html