views:

152

answers:

1

Hi friends, I am getting the data of the file from network and receiving it in NSData(not saving it any were). I want to view the files without saving it anywere.

I tried it with UIWebView but with no success

[webView loadData:data_ MIMEType:@"text" textEncodingName:@"UTF-8" baseURL:nil];

Any hint in right direction would be highly appreciated.

A: 

The MIME type is probably not correct. Here is a list of MIME types, which includes types for handling text files of various formats.

You might also edit your question to include how you are instantiating the NSData instance data__.

Alex Reynolds
Indeed, the mime type should be @"text/plain" for text and @"application/pdf" for PDF files.
Ed Marty
Thanks for your reply. you were right the mime type was not proper for those type files. But I am not able to view .ppt, .pptx, .doc, .docx, .rtf in my webview. I have noted that these files open in safari browser of iPhone.Also when I try to view .pdf files the horizontal scroll comes and the page doesn't fit properly.Can you just give some hint on these.
Ekra