[Webkit-unassigned] [Bug 34442] The Select file dialog show all files when only images/videos/music files expected

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Dec 4 04:19:44 PST 2020


https://bugs.webkit.org/show_bug.cgi?id=34442

--- Comment #8 from Ole Strøm <olestr at pm.me> ---
Hello! This seems to have been forgotten.

Our team just hit a weird thing related to this.

We have an app that lets users distribute recordings.

All was fine, until a colleague tried to select a mp3 file on iOS Safari.

The input field has the accept attribute set to "audio/*", but he was not able to select neither a mp3 nor m4a file from his iCloud Drive.
See https://bug-34442-attachments.webkit.org/attachment.cgi?id=415402 for a screenshot.

His device: iPhone 12 Pro, with iOS 14.2.1.

So we tried to research what this could be. We found some various hits on stackoverflow, but nothing addressed to exactly this.

Caniuse was of little help as well: https://caniuse.com/input-file-accept
There it says iOS Safari (versions 8 - 13.7, 14.2) "Supports the type format (e.g. image/*) but not the extension format (e.g. .png)", which is the opposite of what we're experiencing.

Because it worked as expected when we set accept to ".mp3,.m4a"...
See the replay at https://bug-34442-attachments.webkit.org/attachment.cgi?id=415405 for it in action.

The minimal HTML showcasing can be seen at 
https://bug-34442-attachments.webkit.org/attachment.cgi?id=415404
https://output.jsbin.com/yilametaki

or just inline:

```
<style>
    label {
        display: block;
        margin: 16px;
    }
</style>

<label>
    accept="audio/*"
    <input type="file" accept="audio/*">
</label>

<label>
    accept=".mp3,.m4a"
    <input type="file" accept=".mp3,.m4a">
</label>

<label>
    accept="video/*"
    <input type="file" accept="video/*">
</label>

<label>
    accept="image/*"
    <input type="file" accept="image/*">
</label>
```

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20201204/350b2850/attachment.htm>


More information about the webkit-unassigned mailing list