FileSavePickerUI.TrySetFileName | trySetFileName method

Applies to Windows and Windows Phone

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

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:
© 2014 Microsoft