Am trying to load an excel/ppt/word file in my UIWebView. Am downloading the file into NSData Object and then invoking the "loadData" method on UIWebview.
Below is the code :
[webView loadData:documentData MIMEType:[self getMIMEType:documentURL] textEncodingName:@"UTF-8" baseURL:[NSURL URLWithString:fName]];
The getMIMEType -- returns the mime type depending on the file extension.
Not sure what value needs to go to "baseURL" parameter.
My files are not locally stored and are pulled down from remote servers (across the internet).
Anyway, PDFs load beautifully. But, no excel, word or ppt. It throws an error -- as it invokes the "didFailLoadWithError" delegate method of UIWebView.
on a side note, has anyone figured an approach to handle flash files in an app ?
Writing code is not only about writing instructions to a machine / computer, but also about writing something that could be read, understood, and maintained by others. That's why, I like Cocoa.
Writing code is not only about writing instructions to a machine / computer, but also about writing something that could be read, understood, and maintained by others. That's why, I like Cocoa.
Writing code is not only about writing instructions to a machine / computer, but also about writing something that could be read, understood, and maintained by others. That's why, I like Cocoa.
My case is that, not *all* documents fail to load.
Quote:
Originally Posted by mpek
Hey Folks --
Am trying to load an excel/ppt/word file in my UIWebView. Am downloading the file into NSData Object and then invoking the "loadData" method on UIWebview.
Below is the code :
[webView loadData:documentData MIMEType:[self getMIMEType:documentURL] textEncodingName:@"UTF-8" baseURL:[NSURL URLWithString:fName]];
The getMIMEType -- returns the mime type depending on the file extension.
Not sure what value needs to go to "baseURL" parameter.
My files are not locally stored and are pulled down from remote servers (across the internet).
Anyway, PDFs load beautifully. But, no excel, word or ppt. It throws an error -- as it invokes the "didFailLoadWithError" delegate method of UIWebView.
on a side note, has anyone figured an approach to handle flash files in an app ?
I was able to load .xls,.ppt as well as .pdf file in UIWebView after i loaded them into my application as Resources. If u ppl got the answer pls reply. Otherwise i will post my code for that.
I cant view docx and xlsx files inUIWebview , please send your code here or on my mail ID: thearora@yahoo.co.in
Thanks in advance.
Quote:
Originally Posted by wolverine
I was able to load .xls,.ppt as well as .pdf file in UIWebView after i loaded them into my application as Resources. If u ppl got the answer pls reply. Otherwise i will post my code for that.
I was able to load .xls,.ppt as well as .pdf file in UIWebView after i loaded them into my application as Resources. If u ppl got the answer pls reply. Otherwise i will post my code for that.