UploadOperation.AttachAsync UploadOperation.AttachAsync UploadOperation.AttachAsync UploadOperation.AttachAsync 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 : IAsyncOperationWithProgress<UploadOperation, UploadOperation> AttachAsync()
IAsyncOperationWithProgress<UploadOperation, UploadOperation> AttachAsync() const;
public IAsyncOperationWithProgress<UploadOperation, UploadOperation> AttachAsync()
Public Function AttachAsync() As IAsyncOperationWithProgress(Of UploadOperationUploadOperation)
Windows.Networking.BackgroundTransfer.UploadOperation.attachAsync().done( /* Your success and error handlers */ );

Returns

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.