How to download files from web viewer in my app

Hey community, when I added web viewer to my app when I touch download files from the website it will download it in chrome, But I want to my app jus download the file inside my app and if it is pdf it will show the pdf… And download the files to my app’s own folder in device storage. Is the any way to do that?

How these files download when clicking a link in a web viewer is dependent on the operating system and isn’t something you’ll have control over.

IIRC, on Android the file will open in a new browser window but on iOS you will have the option to download the file to your device. This may have changed.