[Webkit-unassigned] [Bug 284457] New: 'webkitdirectory' Attribute not working as expected in Safari for folder uploads

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Dec 11 06:04:08 PST 2024


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

            Bug ID: 284457
           Summary: 'webkitdirectory' Attribute not working as expected in
                    Safari for folder uploads
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: New Bugs
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: mihail6146 at gmail.com

Created attachment 473542

  --> https://bugs.webkit.org/attachment.cgi?id=473542&action=review

bug on Safari

The webkitdirectory attribute on the <input> element is not functioning correctly in Safari (tested on 17.5 and 18.0). According to the MDN documentation, this attribute should allow users to select directories for upload. However, in Safari, the following issues occur:

Users can select individual files instead of restricting the selection to directories.
This behavior is inconsistent with other browsers (e.g., Chrome, Edge), which support webkitdirectory as intended.

Steps to Reproduce:

1. Use the following HTML snippet in Safari:
<input type="file" webkitdirectory>  
2. Attempt to select a directory.

Example:
https://codepen.io/mihail-gm/pen/OPLRMNY

Expected Behavior:
The input should allow users to select a directory, and all files within that directory should be uploaded as specified in the API.

Actual Behavior:
Safari allows selecting single files instead of directories.

References
https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/webkitdirectory

-- 
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/20241211/b3015230/attachment.htm>


More information about the webkit-unassigned mailing list