I've been trying to load local file contents into WKWebView
as we're migrating off of UIWebView
. I noticed that on UIWebView
I can just pass the file data and it would load perfectly. However, on WKWebView
I would need to save the file locally to a temp directly then pass that file URL for WKWebView
to render as discussed by this answer and this answer
My issue is that everything works for for docx/pptx/xlsx files, but for doc/ppt/xls file I would get this error: "The operation couldn't be completed. (OfficeImportErrorDomain error 912) (null)"
This is how I invoke WKWebView
's method:
webView loadFileURL:self.fileURL allowingReadAccessToURL:self.fileURL
Anyone run into similar issue before? If so how did you resolve it?