πŸ“Œ Feature Request: Support Real-Time File Download (PDF/Excel) to Device Downloads Folder
πŸš€ Summary
Currently, in Expo/React Native, when exporting or downloading files (e.g., PDF or Excel statements), developers must use expo-file-system and expo-sharing. These APIs only allow saving inside the app sandbox (cacheDirectory, documentDirectory) or opening a share dialog.
There is no official way to:
Save files directly into the system Downloads folder (like banking/finance apps do).
Automatically notify users and allow in-app file viewing after download.
🐞 Problem
Files saved in cacheDirectory or documentDirectory are not accessible via the user’s native Downloads app or file manager.
Users expect downloaded statements (Excel/PDF) to appear in Downloads, just like Chrome, Gmail, or WhatsApp.
Workarounds require ejecting from Expo or using native modules (RNFetchBlob, react-native-fs) which break managed workflow.
βœ… Expected Behavior
A simple API like:
const uri = await FileSystem.downloadToDownloadsAsync(
remoteUrlOrBase64,
"Statement.pdf"
);
Should:
Save directly in Downloads (Android) or Files app / iCloud Drive Downloads (iOS).
Send a system notification (Download complete: Statement.pdf).
Allow immediate in-app opening with a viewer (openFile(uri)).
πŸ’‘ Use Case
Banking, wallet, and e-commerce apps where users download monthly statements, order invoices, or reports.
Users expect these files to appear in their Downloads, without needing to "share" manually.
πŸ”§ Current Workarounds
expo-sharing: Requires user interaction, no automatic saving.
expo-file-system: Limited to sandbox storage; not visible in Downloads.
Ejected apps use RNFetchBlob / react-native-fs, but this breaks Expo Managed workflow.
πŸ“‹ Proposal
Introduce a cross-platform API in expo-file-system:
Android β†’ Save to /storage/emulated/0/Download/ with MediaStore.
iOS β†’ Save to Files app Downloads (via UIDocumentInteractionController).
Provide option:
await FileSystem.downloadToDownloadsAsync(urlOrBase64, {
filename: "Statement.xlsx",
mimeType: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
notify: true, // show system notification
openAfterDownload: true, // auto open in viewer
});
πŸ”’ Security Considerations
Respect iOS sandbox; files should still be manageable via Files app.
Explicit user permissions (WRITE_EXTERNAL_STORAGE on Android < 11).
Use Scoped Storage / MediaStore API for Android 10+.
πŸ“Œ In short: We need a first-class Expo API to save/export PDF/Excel directly into Downloads folder with system-level behavior (notification + view), just like real-world banking/finance apps.