Sagar Sagar - 1 year ago 270
Swift Question

How to open & view view .doc, .docx, .rtf, .ppt, .pptx, .xlsx, .xls file in iphone using UIWebview in Document directory?

Can we open & view .doc, .docx, .rtf, .ppt, .pptx, .xls, .xlsx file in iphone using UIWebview?

I am using Document directory to show the file.

.doc file is working fine hereā€¦ but rest of the files' extensions are not working..

if any one has implemented this then please help me...

any code snippet or any web link help...

thanks in advance...

Answer Source

Try this:

     [self.m_webView loadRequest:[NSMutableURLRequest requestWithURL:[NSURL fileURLWithPath:_m_filePath]cachePolicy:NSURLCacheStorageAllowedInMemoryOnly timeoutInterval:3.0]];  

You can change timeoutInterval and cachePolicy, in sometime you have to wait more time to loading.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download