DEV Community
Follow
Why My iPhone File Picker Greyed Out Every PST File I Asked For
WebKit maps MIME types to file extensions, and the iOS Files app uses this mapping to filter file selections. A tool designed to open Outlook PST and OST files found it could not initially support iPads. This was due to WebKit's handling of file extensions; it would drop unknown extensions for the Files app picker. Specifically, .pst, .ost, and .mbox files lacked corresponding MIME types on iOS, causing them to be filtered out. When a file picker's "accept" attribute contained both known and unknown extensions, only the known ones would appear, hiding the intended file types. This behavior led to zero successful file openings from iOS visitors despite the tool working in the WebKit engine. To address this, the tool's accept string is now conditionally built. On Apple touch devices, it only includes extensions that iOS recognizes, like .eml and .zip. If the list of supported formats includes unknown extensions, the "accept" attribute is left empty. The tool then relies on content sniffing after a file is picked to identify valid archives. The homepage has been updated to reflect this workaround, guiding users to select files in the Files app and explaining that the content check happens post-selection. It's crucial to detect iPadOS by touch screen capabilities, not just user agent strings, and to fully test the picker path before claiming platform support.