greetings all,
i’ve been using activestorage for a while now and i added the direct upload feature. however my forms are inside a modal and i want the user to be able to cancel the upload by dismissing the modal. wouldn’t allowing the direct upload js to receive a cancel event be helpful for UX since the user closes the modal the upload and the form submission should halt. or should at least stop the upload on form reset maybe? thoughts?
I ended up implementing a workaround for this in uppy-activestorage-upload, but having a proper cancellation API directly in Active Storage would be much better.
A common example is when someone accidentally selects a very large file when they actually intended to select the file next to it. With direct uploads, that upload may continue in the background even after the user removes the file or resets/closes the form.
Being able to explicitly cancel an in-progress direct upload — or optionally have Active Storage cancel it when the form is reset — would improve the UX and avoid unnecessary bandwidth usage.