FileOpenPickerUI.AddFile | addFile method

Applies to Windows and Windows Phone

Adds the specified file to the list of files that the user has chosen.


var addFileResult = fileOpenPickerUI.addFile(id, file);



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

A unique identifier of the file to add.


Type: IStorageFile

The file to add to the list of files that the user has chosen.

Return value

Type: AddFileResult

The enumeration value that indicates the result of this addFile method.

Certain file types might not be added to the file picker UI, depending on how the app that invoked the file picker has configured the UI. For example, if the app specified picture file types, a music file can't be added. An app that is hosted in the file picker can use the canAddFile method to determine whether a given file would be allowed in the basket for the current file picker session.

The specified id is required to remove a file from the file picker letterbox using the removeFile method.


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]


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



See also

FileOpenPickerUI class
FileOpenPickerUI.CanAddFile method
FileOpenPickerUI.RemoveFile method



© 2014 Microsoft