title: Determine MIME type from NSData?
body: <p>How would you determine the mime type for an NSData object? I plan to have the user to upload a video/picture from their iPhone and have that file be wrapped in a NSData class.</p>
  
  <p>I was wondering if I can tell the mime type from the NSData. There are only a few answers to this question and the most recent one is from 2010 (4 years ago!). Thanks!</p>
  
  <pre><code>NSData *data; // can be an image or video
  NSString *mimeType = [data getMimetype]; // how would I implement getMimeType
  </code></pre>