-
Notifications
You must be signed in to change notification settings - Fork 256
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
Add ability to cancel uploads in processFile #5099
Comments
Hey @raystorm thanks for opening this. We're adding this to our roadmap to consider for future feature work. |
I initially didn't check the |
I encountered the same problem, so I have to use DragZone component instead of the StorageManager. |
On which framework/platform would you like to see this feature implemented?
React
Which UI component is this feature-request for?
Storage (Storage Manager)
Please describe your feature-request in detail.
I am building an Enterprise Content Management System / Digital Asset Management System with Amplify.
I am storing files in an S3 bucket. I have a page, that lets users fill out metadata related to a file, and upload the file.
I am adding a check to see if a file with the same name already exists in the bucket or not. If the file already exists, I want to cancel the upload and report an error message to the user, so they don't accidentally overwrite the existing file.
I am running the following amplify versions:
Note:
I have not filed a bug report for the following issues I found while trying to programmatically cancel a running upload.
processFile()
bubbles all they way to the top of the app, like a JSX syntax error does.clearFiles()
Clears theFileList
but does not fire any of the associated events for removing the files or canceling uploads.onRemoveUpload() && onCancelUpload()
Let me know if I should file Bug Reports for those issues I found.
TLDR: I want to be able to cancel currently running file upload in
processFile()
if file checks fail.Please describe a solution you'd like.
In the
async processFile()
Handler, I would like to return reject the promise.Alternate Solution
Use a reference to cancel all Uploads similar to
clearFiles();
Alternate Solution 2
Disable Auto Upload, and programmatically start the upload in
processFile()
.processFile()
doesn't run until the upload is started, even if I could figure out how to call the start button.Alternate Solution 3
Call the
onCancelUpload()
oronRemoveUpload()
events for the file.They are not callable from the
processFile
object, and I couldn't figure out how to access them from the component.We love contributors! Is this something you'd be interested in working on?
The text was updated successfully, but these errors were encountered: