0

I have a website within WKWebView that has a link to open a PDF, I want to intercept this so that it brings up a share sheet to save the PDF to the iPhone files app.

New to swift so unsure how to do this, I've tried many solutions from other answers and whilst https://stackoverflow.com/a/60614921/11868620 works well, it saves it to a Documents folder linked to my app rather than the Downloads folder in the Files app.

How do I implement this functionality?

Joshua Lowe
  • 21
  • 2
  • 4
  • so you know how to intercept the navigation request... and just want to know how to save a file to Files? try https://stackoverflow.com/questions/46456481/how-to-write-a-file-to-a-folder-located-at-apples-files-app-in-swift – Scriptable Aug 19 '21 at 09:38
  • In the answer mentioned by you, change `.documentDirectory` to `.downloadsDirectory`. – Ely Aug 19 '21 at 10:34
  • You are not supposed to move a file from one location to another without user's consent outside the sandbox folder assigned to your app. – El Tomato Aug 19 '21 at 20:02

0 Answers0