import * as Sharing from 'expo-sharing';import * as FileSystem from 'expo-file-system';// https://www.planetgeek.ch/wp-content/uploads/2013/06/Clean-Code-V2.1.pdfconst downloadFile = async () => {const fileUri = FileSystem.documentDirectory + 'r.pdf'; // Set the file name and directoryconst downloadResumable = FileSystem.createDownloadResumable('https://www.planetgeek.ch/wp-content/uploads/2013/06/Clean-Code-V2.1.pdf', // URL of the file to downloadfileUri, // Location to save the downloaded file{}, // Optional headers to include in the request(downloadProgress) => {const progress = downloadProgress.totalBytesWritten / downloadProgress.totalBytesExpectedToWrite;console.log(`Download progress: ${progress * 100}%`);});try {const { uri } = await downloadResumable.downloadAsync(); // Start the downloadawait Sharing.shareAsync(uri); //Allow user to select location to save fileconsole.log(`Downloaded file stored at: ${uri}`);} catch (error) {console.error(error);}};
https://forums.expo.dev/t/how-to-save-the-file-to-devices-folder-like-download/2398/52