WordPress.org

Make WordPress Core

Opened 2 years ago

Closed 2 years ago

#19050 closed defect (bug) (fixed)

Media Upload - Cancel Upload Button

Reported by: landwire Owned by: azaozz
Milestone: 3.3 Priority: normal
Severity: normal Version: 3.3
Component: Media Keywords:
Focuses: Cc:

Description

What should this button actually do? It cancels the upload while a file is uploading (progress bar moving), but once you have chosen a few files and they all have uploaded, I change my mind and do not want to go ahead with the upload. I press "Cancel Upload", but nothing happens. It should cancel my upload though....

Change History (17)

comment:1 SergeyBiryukov2 years ago

IMO, "Cancel Upload" button does exactly what it says: cancels the upload process. Once the images are uploaded, they can be explicitly deleted from Media Library if not needed.

comment:2 SergeyBiryukov2 years ago

  • Component changed from General to Media

comment:3 follow-up: jane2 years ago

  • Milestone changed from Awaiting Review to 3.3
  • Owner set to azaozz
  • Status changed from new to assigned

Agree with Sergey. Cancel Upload should cancels uploads in progress. Deleting files because you changed your mind is not the same. That said, the Cancel Upload button seems to stay in active state even after crunching is finished, which does make it confusing, and it's inside the new uploader area. @azaozz: why is Cancel Upload still clickable when nothing is actively uploading?

comment:4 jane2 years ago

  • Type changed from enhancement to defect (bug)

comment:5 follow-up: SergeyBiryukov2 years ago

I've also noticed that while "Cancel Upload" button immediately removes the progress bar (creating an impression that the upload is also immediately stopped), the file currently being uploaded silently finishes uploading anyway.

comment:6 in reply to: ↑ 3 azaozz2 years ago

Replying to jane:

@azaozz: why is Cancel Upload still clickable when nothing is actively uploading?

Seems to be a bug from the initial integration of Plupload (GSoC) that went unnoticed until now... Fixing.

comment:7 azaozz2 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In [19099]:

Disable the Cancel Upload button after the upload has finished or if it was interrupted, fixes #19050

comment:8 in reply to: ↑ 5 ; follow-up: nacin2 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Replying to SergeyBiryukov:

I've also noticed that while "Cancel Upload" button immediately removes the progress bar (creating an impression that the upload is also immediately stopped), the file currently being uploaded silently finishes uploading anyway.

comment:9 in reply to: ↑ 8 ; follow-up: azaozz2 years ago

Replying to nacin:

Don't think you can stop the browser finishing the uploading of the current file from JS, but patches welcome.

comment:11 in reply to: ↑ 9 ; follow-up: SergeyBiryukov2 years ago

Replying to azaozz:

Don't think you can stop the browser finishing the uploading of the current file from JS

Maybe we can reflect that in UI (e.g. by not removing current progress bar)?

comment:12 in reply to: ↑ 10 azaozz2 years ago

Replying to ocean90:

Maybe possible with chunked upload?

By default we are not using chunking, it doesn't work well in all browsers when using the HTML5 runtime that supports drag & drop.

On the other hand we could try to hook at the HXR and use abort(), not sure if that's exposed or if the browsers would execute it.

Last edited 2 years ago by azaozz (previous) (diff)

comment:13 in reply to: ↑ 11 ; follow-up: azaozz2 years ago

Replying to SergeyBiryukov:

Maybe we can reflect that in UI (e.g. by not removing current progress bar)?

I'm starting to think we should drop the Cancel button completely. Other similar setups don't have "cancel" either (like G+). Users can cancel by closing the popup/reloading the page.

comment:14 in reply to: ↑ 13 jane2 years ago

Replying to azaozz:

I'm starting to think we should drop the Cancel button completely. Other similar setups don't have "cancel" either (like G+). Users can cancel by closing the popup/reloading the page.

Fine by me.

comment:15 follow-up: olleicua2 years ago

  • Cc olleicua@… added

It occurs to me that a small 'x' appearing in the loading bar only during the upload might be really helpful if for example someone mis-clicks and gets the wrong file.

comment:16 in reply to: ↑ 15 azaozz2 years ago

Replying to olleicua:

The problem is that we can't cancel the currently uploading file from JS (for now). Only way would be to reload the page or close the popup.

comment:17 azaozz2 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In [19127]:

Remove the Cancel Upload button, fixes #19050

Note: See TracTickets for help on using tickets.