Sagar Sagar - 4 months ago 86
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...


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.