Bug 239001 - iOS File input accepts type not being respected and always uploads a jpeg
Summary: iOS File input accepts type not being respected and always uploads a jpeg
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-04-08 08:05 PDT by Ant Dodds
Modified: 2022-05-12 11:32 PDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ant Dodds 2022-04-08 08:05:05 PDT
On iOS 15 devices given the following form

<form action="" method="POST" enctype="multipart/form-data">
    <input type="file" name="uploaded-file[]" accept="image/heic, image/heif, image/png" multiple="multiple" />
    <br >
    <input name="submit" type="submit" value="Submit" />
</form>

When using the "Photo Library" option, images that are jpeg can be selected.
When submitting the form the reported mime type that is received server side is image/jpeg, which is not listed as an accepted format, the file data received is also jpeg not the accepted formats.

If I have saved the files to the device from the photos app and use "Choose files", jpeg files are still selectable, but we do get the correct file data and mime-types for heic/heif, and png files.

While there is a work around to get the correct file types we are looking for, getting people to do this isn't reasonable, the desired outcome for this would be if I as a user select a heic/heif for upload the system gets the correct file regardless of where the selection has been made, be this the photos app or choose files.

Thanks,
Comment 1 Radar WebKit Bug Importer 2022-04-15 08:06:13 PDT
<rdar://problem/91807745>