0

I'm coding a web app that uses a picture that the user can upload from their phones/computers and I found out that ios 5 doesn't allow you to upload anything (see A html5 web app for mobile safari to upload images from the Photos.app?).

Since it seems pretty much impossible I want to show a message to those users asking them to upgrade or pointing them to alternative solutions described in the link above (piccup and the like) if they want to use my app.

Can I direct this message just to ios 5 users via a media query or something similar?

Community
  • 1
  • 1
Elaine Marley
  • 2,143
  • 6
  • 50
  • 86

3 Answers3

1

Are you looking for a server side solution (Like PHP for example) or client side (JavaScript)?:

Here is a JavaScript solution:

<script type="text/javascript">
    if (navigator.userAgent.match(/OS 5(_\d)+ like Mac OS X/i))
        // this helps detect minor versions such as 5_0_1
        document.write("You have iOS 5! Aren't you special!");
</script>

Source: https://stackoverflow.com/a/13087526/1800369

For PHP you can track this: Detect iOS version with PHP

Community
  • 1
  • 1
Plamen Nikolov
  • 2,643
  • 1
  • 13
  • 24
  • Well both could work for me as long as I can get the message to the user. Thank you very much, I'll look into it and give the bounty if it works! – Elaine Marley Nov 15 '12 at 11:40
  • Yes! this did the trick, I checked on ios5 and ios6 and the message showed only on the ios5 phone. Fantastic! – Elaine Marley Nov 20 '12 at 12:34
0

As you mention media queries I guess you want to do this in your CSS. Perhaps detecting the screen width of 1136px (according to orientation) would do the trick for you?

More here

Community
  • 1
  • 1
A.M. D.
  • 928
  • 6
  • 10
  • No, I need to target all ios5 devices regardless of screen width. I mentioned media queries but I wasn't too sure that would be the way to go. – Elaine Marley Nov 20 '12 at 12:30
0

You should check with jQuery for file input support. Please check an answer to this question on how to do this. Note that author stated that this snippet will return true on some Android devices even if they don't support input elements, but since you asked specifically about an iPhone I think it should do the job.

Community
  • 1
  • 1
  • I didn't really mention android users because I didn't find them unable to upload images to the website but I can't use that solution becuse it will break it for them. – Elaine Marley Nov 20 '12 at 12:31