not work in ipad

2019-02-21 03:10发布

问题:

i use JSF <t:inputFileUpload> tag to upload files to my site. It works properly in a PC with all browsers but when I test it in my iPad it does not work. It shows as disabled in iOS 5. It uploads images but not text files or pdf or word or excel files in iOS 6.

Have you faced a similar situation? How can I upload documents and spreadsheets from an iPad onto my site?

回答1:

This problem is not specific to JSF. It's basically just a HTML code generator. It runs on webserver and produces a bunch of HTML which get sent to the client (in your case, the iPad) and then interpreted over there. The <t:inputFileUpload> just generates a HTML <input type="file">.

That HTML element is in turn indeed disabled in Safari Mobile based browsers. JSF look like a magician, but it really can't control whatever the client decides to do with the retrieved HTML. You'd need to look for a 3rd party client side library which enables this in the Safari Mobile side.

See also:

  • A html5 web app for mobile safari to upload images from the Photos.app?
  • upload files via iPad
  • HTML file browse not working in iPad