---
title: "webView(_:runOpenPanelForFileButtonWith:)"
framework: webkit
role: symbol
role_heading: Instance Method
path: "webkit/webuidelegate/webview(_:runopenpanelforfilebuttonwith:)"
---

# webView(_:runOpenPanelForFileButtonWith:)

Displays an open panel for a file input control.

## Declaration

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

## Parameters

- `sender`: The web view that sent the message.
- `resultListener`: See the doc://com.apple.webkit/documentation/WebKit/WebOpenPanelResultListener protocol for how to set these values.

## Discussion

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.

## See Also

### Opening Panels

- [webView(_:runJavaScriptAlertPanelWithMessage:initiatedBy:)](webkit/webuidelegate/webview(_:runjavascriptalertpanelwithmessage:initiatedby:).md)
- [webView(_:runJavaScriptConfirmPanelWithMessage:initiatedBy:)](webkit/webuidelegate/webview(_:runjavascriptconfirmpanelwithmessage:initiatedby:).md)
- [webView(_:runJavaScriptTextInputPanelWithPrompt:defaultText:initiatedBy:)](webkit/webuidelegate/webview(_:runjavascripttextinputpanelwithprompt:defaulttext:initiatedby:).md)
- [webView(_:runOpenPanelForFileButtonWith:allowMultipleFiles:)](webkit/webuidelegate/webview(_:runopenpanelforfilebuttonwith:allowmultiplefiles:).md)
- [webView(_:runBeforeUnloadConfirmPanelWithMessage:initiatedBy:)](webkit/webuidelegate/webview(_:runbeforeunloadconfirmpanelwithmessage:initiatedby:).md)
