UploadOperation.AttachAsync Method

Definition

Returns an asynchronous operation that can be used to monitor progress and completion of the attached upload. Calling this method allows an app to attach upload operations that were started in a previous app instance.

public:
 virtual IAsyncOperationWithProgress<UploadOperation ^, UploadOperation ^> ^ AttachAsync() = AttachAsync;
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperationWithProgress<UploadOperation, UploadOperation const&> AttachAsync();
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperationWithProgress<UploadOperation,UploadOperation> AttachAsync();
function attachAsync()
Public Function AttachAsync () As IAsyncOperationWithProgress(Of UploadOperation, UploadOperation)

Returns

Upload operation with callback.

Attributes

Examples

function AttachUpload (loadedUpload) {
    try {
        upload = loadedUpload;
        promise = upload.attachAsync().then(complete, error, progress);
    } catch (err) {
        displayError(err);
    }
};

Remarks

While this method can be called from multiple app instances, developers should not attach callbacks from the primary app instance in a background task. This will cause BackgroundTransferHost.exe to hang.

Applies to