title: view .doc, .docx, .rtf, .ppt file in iphone using Webview
body: <p>I want to view .doc, .docx, .rtf, .ppt file in iphone.</p>
  
  <p>But I guess something is going wrong at my side and its not working for the above formats but my code is working fine for .txt and .pdf files.</p>
  
  <p>I have the read the document regarding Webview it states it supports viewing of the above document.</p>
  
  <p>below is my snippet for .doc </p>
  
  <pre><code>[webView loadData:requestData MIMEType:@"application/msword" textEncodingName:@"UTF-8" baseURL:nil];
  </code></pre>
  
  <p>for .ppt I am using MIME type as <code>"application/vnd.ms-powerpoint"</code></p>
  
  <p>Note: If I am making MIME type as "text/html" for .doc/.rtf then it displays some garbage data  So I think there is something missing in MIME type from my side.</p>
  
  <p>Any help is highly appreciated.</p>
  
  <p>Waiting for your reply.</p>
  
  <p><strong>Update</strong>:........</p>
  
  <p>It seems there is some issue with NSData for opening these type of file formats.
  My data is encrypted so I cannot use 
  <strong>requestWithURL</strong> directly and other thing is I need to pass credentials to get the file and the credentials doesnt work proplerly if I save the credentials using </p>
  
  <pre><code>[[NSURLCredentialStorage sharedCredentialStorage] setDefaultCredential:credential
                                          forProtectionSpace:protectionSpace];
  </code></pre>
  
  <p>and then make the request using below</p>
  
  <pre><code>[webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]] ]
  </code></pre>
  
  <p>Is there any way I can use NSData for the above formats so that I can make async call and pass my credentials and then decrypt the data and show it in WebView.</p>