title: File associating on iOS - opening a plain-text file from Safari
body: <p>I want to associate a text-based custom file type with my app on iOS.</p>
  
  <p>When I open a link to the file which is behind some php script, Safari shows the "open in" option with my app in it, which is OK.</p>
  
  <p>However when I open a link which points directly to my file (running a web server for test purposes), Safari decides that it can read the file itself and displays the content by itself. Which is definitely not OK.</p>
  
  <p>On the side note, if I substitute any binary file (zip, ...) and use my extension, file associating will still work.</p>
  
  <p>The code in plist-info:</p>
  
  <pre><code>&lt;key&gt;CFBundleDocumentTypes&lt;/key&gt;
  &lt;array&gt;
      &lt;dict&gt;
          &lt;key&gt;CFBundleTypeIconFiles&lt;/key&gt;
          &lt;array&gt;
              &lt;string&gt;320.png&lt;/string&gt;
              &lt;string&gt;64.png&lt;/string&gt;
          &lt;/array&gt;
          &lt;key&gt;CFBundleTypeName&lt;/key&gt;
          &lt;string&gt;My File&lt;/string&gt;
          &lt;key&gt;CFBundleTypeRole&lt;/key&gt;
          &lt;string&gt;Viewer&lt;/string&gt;
          &lt;key&gt;LSHandlerRank&lt;/key&gt;
          &lt;string&gt;Owner&lt;/string&gt;
          &lt;key&gt;LSItemContentTypes&lt;/key&gt;
          &lt;array&gt;
              &lt;string&gt;com.Company.Product.ext&lt;/string&gt;
          &lt;/array&gt;
      &lt;/dict&gt;
  &lt;/array&gt;
  &lt;key&gt;UTExportedTypeDeclarations&lt;/key&gt;
  &lt;array&gt;
      &lt;dict&gt;
          &lt;key&gt;UTTypeConformsTo&lt;/key&gt;
          &lt;array&gt;
              &lt;string&gt;public.data&lt;/string&gt;
              &lt;string&gt;public.content&lt;/string&gt;
              &lt;string&gt;public.text&lt;/string&gt;
              &lt;string&gt;public.plain-text&lt;/string&gt;
              &lt;string&gt;public.utf16-plain-text&lt;/string&gt;
              &lt;string&gt;public.utf16-external-plain-text&lt;/string&gt;
              &lt;string&gt;public.utf8-plain-text&lt;/string&gt;
          &lt;/array&gt;
          &lt;key&gt;UTTypeDescription&lt;/key&gt;
          &lt;string&gt;My File&lt;/string&gt;
          &lt;key&gt;UTTypeIdentifier&lt;/key&gt;
          &lt;string&gt;com.Company.Product.ext&lt;/string&gt;
          &lt;key&gt;UTTypeTagSpecification&lt;/key&gt;
          &lt;dict&gt;
              &lt;key&gt;public.filename-extension&lt;/key&gt;
              &lt;string&gt;ext&lt;/string&gt;
              &lt;key&gt;public.mime-type&lt;/key&gt;
              &lt;string&gt;application/octet-stream&lt;/string&gt;
          &lt;/dict&gt;
      &lt;/dict&gt;
  &lt;/array&gt;
  </code></pre>
  
  <p>My question is: how to persuade Safari to NOT open the file itself? It it even possible? Do I have to use some mime type other than "application/octet-stream"?</p>