<!--
{
  "availability" : [
    "macOS: 10.3.0 - 10.14.0"
  ],
  "documentType" : "symbol",
  "framework" : "WebKit",
  "identifier" : "/documentation/WebKit/WebUIDelegate/webView(_:runOpenPanelForFileButtonWith:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "WebKit"
    ],
    "preciseIdentifier" : "c:objc(pl)WebUIDelegate(im)webView:runOpenPanelForFileButtonWithResultListener:"
  },
  "title" : "webView(_:runOpenPanelForFileButtonWith:)"
}
-->

# webView(_:runOpenPanelForFileButtonWith:)

Displays an open panel for a file input control.

```
optional func webView(_ sender: WebView!, runOpenPanelForFileButtonWith resultListener: (any WebOpenPanelResultListener)!)
```

## Parameters

`sender`

The web view that sent the message.

`resultListener`

See the [`WebOpenPanelResultListener`](/documentation/WebKit/WebOpenPanelResultListener) protocol for how to set these values.

## Discussion

This method uses a listener object to set the results of the open panel, instead of returning the value directly. This approach allows delegates to implement the open panel as a modal dialog. No action is taken if you do not implement this method.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)