2

Through Document Interaction, my iOS app registers itself as an editor of .sgf and .ugi files. So I can open such files from - let's say - attachements in Mail.

However, when trying the same from Safari, I get inconsistent behavior. I try to open .sgf documents that are available via HTTP into my App.

Some http links trigger the gray box with "Open in..." button... Good.

http://gtl.xmp.net/reviews/data/82/8201-DavidB-mukai-jettero.sgf

Other links open as a text file in Safari... Unwanted.

http://learngo.world-go.org/golibrary/samplelessons/studygroup30k/2004-06-11_20-30k.sgf

Is there a way to get the "open in..." button on all?

apaderno
  • 28,547
  • 16
  • 75
  • 90
Kris Van Bael
  • 2,842
  • 1
  • 18
  • 19

1 Answers1

0

After some research I got most of the answer from this page:

https://developer.mozilla.org/en/Properly_Configuring_Server_MIME_Types

And this web tool:

http://www.rexswain.com/httpview.html

SafariMobile looks at the MIME-type that is returned by the web server to determine what to do with the link (view within Safari or offer 'Open In...'.

Supported types like 'text/plain', 'text/html', 'image/gif' are all displayed within Safari. Whereas an unsupported type like 'application/zip' will trigger the 'Open in...' interface.

But Safari will even try to display a link of the type 'application/octet-stream', which is the mime-type typically used for unknown binary formats. I suppose Apple did this to overcome web servers that fail to provide the proper mime-type.

Supplying the type along within the HTML code is ignored by Safari.

<a href='file.sgf' type='application/x-go-sgf'>

The only (I think) solution is to change the configuration of the web server.

Kris Van Bael
  • 2,842
  • 1
  • 18
  • 19
  • I have been looking for the answer to this for a whole day. Thank you for posting here. It seems there is little we can do to overcome MobileSafari's over-zealousness to open files; what puzzles me is why the behavior is so inconsistent, some octet-stream files do open properly! – Steven Lu Sep 05 '13 at 20:40