Click or drag to resize

IDialogHandlerOnFileDialog Method

Version 88.2.90
Runs a file chooser dialog.

Namespace:  CefSharp
Assembly:  CefSharp (in CefSharp.dll) Version: 88.2.90.0 (88.2.90.0)
Syntax
bool OnFileDialog(
	IWebBrowser chromiumWebBrowser,
	IBrowser browser,
	CefFileDialogMode mode,
	CefFileDialogFlags flags,
	string title,
	string defaultFilePath,
	List<string> acceptFilters,
	int selectedAcceptFilter,
	IFileDialogCallback callback
)

Parameters

chromiumWebBrowser
Type: CefSharpIWebBrowser
the ChromiumWebBrowser control
browser
Type: CefSharpIBrowser
the browser object
mode
Type: CefSharpCefFileDialogMode
represents the type of dialog to display
flags
Type: CefSharpCefFileDialogFlags
further specifies behavior dialog should exhibit
title
Type: SystemString
the title to be used for the dialog. It may be empty to show the default title ("Open" or "Save" depending on the mode).
defaultFilePath
Type: SystemString
is the path with optional directory and/or file name component that should be initially selected in the dialog.
acceptFilters
Type: System.Collections.GenericListString
are used to restrict the selectable file types and may any combination of (a) valid lower-cased MIME types (e.g. "text/*" or "image/*"), (b) individual file extensions (e.g. ".txt" or ".png"), (c) combined description and file extension delimited using "|" and ";" (e.g. "Image Types|.png;.gif;.jpg").
selectedAcceptFilter
Type: SystemInt32
is the 0-based index of the filter that should be selected by default.
callback
Type: CefSharpIFileDialogCallback
Callback interface for asynchronous continuation of file dialog requests.

Return Value

Type: Boolean
To display a custom dialog return true. To display the default dialog return false.
Examples
To test assign something like TempFileDialogHandler (from CefSharp.Example) to DialogHandler e.g.
browser.DialogHandler = new TempFileDialogHandler();
Example URL to use for file browsing http://www.cs.tut.fi/~jkorpela/forms/file.html#example Simply click browse, the space next to the browse button should be populated with a randomly generated filename.
See Also