title: Recognising UIWebView file types
body: <p>I wish to detect when a PDF has been clicked and display it in a separate UIWebView. Here's what I have currently:</p>
  
  <pre><code>- (BOOL) webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType; {
      NSURL *url = [request URL];
      NSString *urlString = [url absoluteString];
      if (fileType != @"PDF") {
  
          if([urlString rangeOfString:@".pdf"].location == NSNotFound){
              return true;
          } else {
              NSURL *filePath = [NSURL URLWithString:urlString];
              NSURLRequest *requestObj = [NSURLRequest requestWithURL:filePath];
              [pdfViewer loadRequest:requestObj];
              [self.view addSubview:topView];
  
              fileType = @"PDF";
  
              return false;
          }
      } else {
          return true;
      }   
  }
  </code></pre>
  
  <p>This works fine. However it does have one Glaring Flaw:</p>
  
  <p>What about "http://www.example.com/ikb3987basd"</p>
  
  <p>How can I recognise a file type without the extension? Is there some sort of data about the file that I can check on?</p>