Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[S3 Docs] .upload / ManagedUpload does not document how to abort upload #441

Closed
mfn opened this issue Dec 15, 2014 · 4 comments
Closed

[S3 Docs] .upload / ManagedUpload does not document how to abort upload #441

mfn opened this issue Dec 15, 2014 · 4 comments
Labels
documentation This is a problem with documentation.

Comments

@mfn
Copy link

mfn commented Dec 15, 2014

The documentation at http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3/ManagedUpload.html does not describe how to actually abort an upload which is in progress.

Through trial and error I found this pattern to "work for me"; but I'm neither sure if it's a good idea nor if it's supposed to work that way:

var manager = bucket.upload(...);
bucket.send(function(err,data)) {
  if (!err && !data) {
    // user aborted
  }
}

// somewhere else
function cancelUpload() {
  manager.cleanup();
}
@lsegal
Copy link
Contributor

lsegal commented Dec 15, 2014

You should not use cleanup() as that is a private method of the ManagedUpload class and may change. The correct method will be (edit) manager.abort(), similar to the Request.abort method, but this has not yet been exposed.

@lsegal lsegal added the documentation This is a problem with documentation. label Dec 15, 2014
@lsegal lsegal closed this as completed in 74a7ad9 Dec 15, 2014
@lsegal
Copy link
Contributor

lsegal commented Dec 15, 2014

I just exposed the abort() method to match the AWS.Request interface which is a public method that will be documented in the next release.

AdityaManohar added a commit that referenced this issue Dec 17, 2014
@onassar
Copy link

onassar commented Oct 17, 2015

@lsegal is abort currently supported in browser version of sdk? Calling it seems to go through, but the upload is continuing.

@lock
Copy link

lock bot commented Sep 29, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@lock lock bot locked as resolved and limited conversation to collaborators Sep 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation This is a problem with documentation.
Projects
None yet
Development

No branches or pull requests

3 participants