FileUpdateRequest FileUpdateRequest FileUpdateRequest FileUpdateRequest Class


Provides information about a requested file update so that the app can complete the request.

public : sealed class FileUpdateRequest : IFileUpdateRequest, IFileUpdateRequest2
public sealed class FileUpdateRequest : IFileUpdateRequest, IFileUpdateRequest2
Public NotInheritable Class FileUpdateRequest Implements IFileUpdateRequest, IFileUpdateRequest2
// This class does not provide a public constructor.
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0 - for Xbox, see UWP features that aren't yet supported on Xbox)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)


The File picker contracts sample demonstrates how to respond to a FileUpdateRequested event, including how to use Request to get the FileUpdateRequest.

// Event handler
void CachedFileUpdaterUI_FileUpdateRequested(CachedFileUpdaterUI sender, FileUpdateRequestedEventArgs args)
    fileUpdateRequest = args.Request;
    fileUpdateRequestDeferral = fileUpdateRequest.GetDeferral();
    switch (cachedFileUpdaterUI.UIStatus)
        case UIStatus.Hidden:
            fileUpdateRequest.Status = FileUpdateStatus.UserInputNeeded;
        case UIStatus.Visible:
        case UIStatus.Unavailable:
            fileUpdateRequest.Status = FileUpdateStatus.Failed;

// Register for the event
cachedFileUpdaterUI.FileUpdateRequested += CachedFileUpdaterUI_FileUpdateRequested;

// Event handler
function onFileUpdateRequest(e) {
    fileUpdateRequest = e.request;
    fileUpdateRequestDeferral = fileUpdateRequest.getDeferral();

    switch (cachedFileUpdaterUI.uiStatus) {
        case Windows.Storage.Provider.UIStatus.hidden:
            fileUpdateRequest.status = Windows.Storage.Provider.FileUpdateStatus.userInputNeeded;
        case Windows.Storage.Provider.UIStatus.visible:
            var url = scenarios[0].url;
            WinJS.Navigation.navigate(url, cachedFileUpdaterUI);
        case Windows.Storage.Provider.UIStatus.unavailable:
            fileUpdateRequest.status = Windows.Storage.Provider.FileUpdateStatus.failed;

// Register for the event
cachedFileUpdaterUI.addEventListener("fileupdaterequested", onFileUpdateRequest);

Both args and e (in C# and JS respectively) contain a FileUpdateRequestedEventArgs object.


If your app participates in the Cached File Updater contract, use this class to respond when Windows fires FileUpdateRequested events to request file updates. You can access this class from your event handler using the FileUpdateRequestedEventArgs.@Windows.Storage.Provider.FileUpdateRequestedEventArgs.Request?text=Request property. As a part of your response to a FileUpdateRequested event, you must set the Status property of this class to indicate the status of the update.

Learn more about responding to update requests in FileUpdateRequested and FileUpdateRequestedEventArgs.

If your app can't complete the update before returning from its FileUpdateRequested event handler, you can use the GetDeferral property to finish the update asynchronously.


ContentId ContentId ContentId ContentId

Gets the unique identifier used to associate the local version of a file with the corresponding remote version.

public : Platform::String ContentId { get; }
public string ContentId { get; }
Public ReadOnly Property ContentId As string
var string = fileUpdateRequest.contentId;
Platform::String string string string

The identifier that was specified by the app and is associated with the local file.

File File File File

Gets a StorageFile object that represents the locally cached copy of the file to update.

public : StorageFile File { get; }
public StorageFile File { get; }
Public ReadOnly Property File As StorageFile
var storageFile = fileUpdateRequest.file;
StorageFile StorageFile StorageFile StorageFile

The StorageFile object that represents the locally cached copy of the file to update.

Status Status Status Status

Gets or sets the status of the update. This property is set in response to a FileUpdateRequested event.

public : FileUpdateStatus Status { get; set; }
public FileUpdateStatus Status { get; set; }
Public ReadWrite Property Status As FileUpdateStatus
var fileUpdateStatus = fileUpdateRequest.status;
fileUpdateRequest.status = fileUpdateStatus;
FileUpdateStatus FileUpdateStatus FileUpdateStatus FileUpdateStatus

An enum value that indicates the status of the update.

UserInputNeededMessage UserInputNeededMessage UserInputNeededMessage UserInputNeededMessage

Gets or sets a message to the user indicating that user input is needed to complete the FileUpdateRequest.

public : Platform::String UserInputNeededMessage { get; set; }
public string UserInputNeededMessage { get; set; }
Public ReadWrite Property UserInputNeededMessage As string
var string = fileUpdateRequest.userInputNeededMessage;
fileUpdateRequest.userInputNeededMessage = string;
Platform::String string string string

A message to the user indicating that user input is needed to complete the FileUpdateRequest.


GetDeferral() GetDeferral() GetDeferral() GetDeferral()

Gets an object used to complete an update asynchronously.

public : FileUpdateRequestDeferral GetDeferral()
public FileUpdateRequestDeferral GetDeferral()
Public Function GetDeferral() As FileUpdateRequestDeferral
var fileUpdateRequestDeferral = fileUpdateRequest.getDeferral();

The object that the app uses to indicate, asynchronously, that it has finished responding to a FileUpdateRequested event and that the Request is complete.


If you don't call this method, a request is considered complete as soon as the FileUpdateRequested event handler returns— regardless of outstanding asynchronous operations.

UpdateLocalFile(IStorageFile) UpdateLocalFile(IStorageFile) UpdateLocalFile(IStorageFile) UpdateLocalFile(IStorageFile)

Provide a new version of the local file to represent the remote file.

public : void UpdateLocalFile(IStorageFile value)
public void UpdateLocalFile(IStorageFile value)
Public Function UpdateLocalFile(value As IStorageFile) As void
IStorageFile IStorageFile IStorageFile IStorageFile

The new version of the local file that will represent remote file.

This file can be different from the original local file that was associated with the FileUpdateRequest.ContentId.


Use this method to associate a new version of the local file with the existing ContentId. You need to use this method whenever you create a new version of the local file. For example, you would call this method if you used ReplaceWithStreamedFileAsync or ReplaceWithStreamedFileFromUriAsync to download the latest version of the file, or if the remote version of the file was renamed.