Windows Dev Center

FileSavePickerUI.TrySetFileName | trySetFileName method

Tries to set the file name and extension in the file picker UI.

Syntax


var setFileNameResult = fileSavePickerUI.trySetFileName(value);

Parameters

value

Type: String [JavaScript] | System.String [.NET] | Platform::String [C++]

The file name and extension that are used to update the file name text box and file type drop-down menu in the file picker UI.

Return value

Type: SetFileNameResult

The enumeration value that indicates whether the file name and extension were updated in the file picker UI.

Remarks

As the provider of a save location, your app should call this method when the user selects a file that is displayed on your app page (which is hosted in the file picker).

This method fails if:

  • The extension specified for the file in value isn't one of the allowedFileTypes.
  • The file picker UI isn't visible to the user.
  • The user is interacting with the file name text box in the file picker UI.

Requirements (Windows 10 device family)

Device family

Universal

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.Storage.Pickers.Provider
Windows::Storage::Pickers::Provider [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Namespace

Windows.Storage.Pickers.Provider
Windows::Storage::Pickers::Provider [C++]

Metadata

Windows.winmd

See also

FileSavePickerUI

 

 

Show:
© 2015 Microsoft