Not possible to specify correct file filter for file open dialog initated in a webpage view on webbrowser on IOS.
The attribute ACCEPT on the HTML element INPUT with TYPE= ”file” is in IOS seems to not be interpreted according to official HTML standard as defined by W3C:
Fo reference, please see:
Steps to Reproduce:
1. Create a webpage that may produce a file dialog, like this example:
<form action="nopage.html" method="post" enctype="multipart/form-data">
<input type="file" accept="image/png,image/jpeg,application/pdf">
<input type="submit" name="submit" value="Submit">
2. View the webpage built on this, or similar, code in a web browser on IOS.
3. Open the file dialog.
When the file dialog windows is used to browse a file directory containing files of different types, all files of the types PNG, JPG and PDF should be selectable. No other file types should be selectable.
Expected results in general is that selectable file types in a file dialog open from a webpage in this way should be according to the type specified in the accept attribute of the input element with type=file.
When the file dialog windows is used to browse a file directory containing files of different types, only files of the types PNG ang JPG is selectable.
Actual results in general is that the accept attribute, of the input element with type=file, does not result in the correct file types being selectable.
Alternative actual results is that some combinations of types specified in accept attribute will result in alla files being selectable.
Mobile Safari on iPhone 7 (model MN952QB/A).
Mobile Safari on iPad Pro 10 inch (model MQF22KN/A).
Firefox Focus on iPhone 7
Firefox Focus on iPad Pro 10 inch.
Possible related bugs (but not the same description/reasoning):
This bug earlier reported in radar as:
1. My earlier tests seems to show that *no* other MIME-types than image/* works? No variant of application/ or other MIME-group seem to work. "Work" in this case = affect what files being selectable. "Earlier" in this case = IOS 11.x - I have not retested this specifically under IOS 12.x.
2. Personal speculation: I get association to the time before the Apple File-app was part of IOS. Before that you could only upload images. This looks to be some kind of remains of that time?
3. Since I am not a WebKit-developer I am not 100% sure whether this is a WebKit-bug or a IOS-bug. My apology if I am in error.
4. I am of course available as test user for any sort of testing related to this reported bug.
5. Real world consequences of this bug:
There is web applications that a user today can not use in full on IOS. For security reasons an application may specify a narrow set of file types that are allowed to be uploaded to server. But since the accept-definition seems to not work correctly in WebKit/IOS the user are not able to upload some files that are needed for using the system. I.e. user have to interrupt their workflow on an iPhone/iPad to do some of the work on a traditional computer (laptop/desktop).