0

I am building a Flutter app and need to implement functionality to download a PDF file and save it to the Downloads folder on iOS devices. Additionally, I want the file to appear in the Recents section of the Files app.

1 Answer 1

1

You should first download the file into the application folder using https://pub.dev/packages/path_provider.

String dir = (await getApplicationDocumentsDirectory()).path;
File file = File("$dir/$fileName.$fileExtension");

Then, let users choose a folder to copy the file to using https://pub.dev/packages/flutter_file_dialog, which provides a dialog for saving files.

final params = SaveFileDialogParams(sourceFilePath: file.path);
final savedPath = await FlutterFileDialog.saveFile(params: params);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.