Can't deselect file controls

Bug #257485 reported by Eviltechie
30
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Launchpad itself
Triaged
High
Unassigned

Bug Description

If a form contains a file control, and select a file to upload, some browsers (like Firefox and Safari) don't let you deselect the file. Other browsers let you deselect the file by clearing the text field, but it's not an obvious way of doing it.

The bug attachment form is an example of a form with a file control, but this affects other forms as well.

Revision history for this message
Björn Tillenius (bjornt) wrote : Re: [Bug 257485] [NEW] Can't not attach a file

On Wed, Aug 13, 2008 at 03:36:27AM -0000, Eviltechie wrote:
> Public bug reported:
>
> I can easily attach a file. But after I selected what file to attach, I
> can't remove it b/c it won't let me remove the link.

Which link are you referring to? Can you maybe provide a screenshot? It
is possible to delete attachments, so I need more information to decide
whether this is a bug or not.

    status incomplete
    subscribe bjornt

Changed in malone:
status: New → Incomplete
Revision history for this message
Eviltechie (eviltechie) wrote : Re: Can't not attach a file

After clicking on browse, and selecting a file to attach, there is no way to not attach the file because it won't let you remove the text in the attachment box.

Revision history for this message
Björn Tillenius (bjornt) wrote : Re: [Bug 257485] Re: Can't not attach a file

On Wed, Aug 13, 2008 at 04:07:16PM -0000, Eviltechie wrote:
> After clicking on browse, and selecting a file to attach, there is no
> way to not attach the file because it won't let you remove the text in
> the attachment box.

I'm not sure I would consider this a bug in Launchpad, this looks like a
browser bug to me. Or is there a way of getting Firefox to let you
remove the text?

Revision history for this message
Eviltechie (eviltechie) wrote :

Ohh your right. It is a firefox bug. Sorry for the trouble.

On Wed, Aug 13, 2008 at 12:25 PM, Björn Tillenius <email address hidden>wrote:

> On Wed, Aug 13, 2008 at 04:07:16PM -0000, Eviltechie wrote:
> > After clicking on browse, and selecting a file to attach, there is no
> > way to not attach the file because it won't let you remove the text in
> > the attachment box.
>
> I'm not sure I would consider this a bug in Launchpad, this looks like a
> browser bug to me. Or is there a way of getting Firefox to let you
> remove the text?
>
> --
> Can't not attach a file
> https://bugs.launchpad.net/bugs/257485
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in Launchpad Bugs: Incomplete
>
> Bug description:
> I can easily attach a file. But after I selected what file to attach, I
> can't remove it b/c it won't let me remove the link.
>

--
Benjamin Franklin

Those who would give up essential liberty to purchase a little temporary
safety, deserve neither liberty nor safety.

Changed in malone:
status: Incomplete → Invalid
Revision history for this message
Matthew Paul Thomas (mpt) wrote : Re: Can't not attach a file

Firefox and Safari deliberately do not (and IE/Mac did not) let people type or edit the path of a file they're uploading. I don't know if Safari's reasons are public, though Mac OS has always avoided exposing full file paths to humans where practical. But in Firefox's case, at least, it was for security reasons. If the file upload control contains an editable field, there are effectively infinitely many ways in which the control can be made to look like an ordinary text field. And if people can be tricked into typing the path of a sensitive file in that field, they'll upload it without realizing. <https://bugzilla.mozilla.org/show_bug.cgi?id=258875>

Now, you could still say it's a browser bug that browsers don't provide an explicit button for deselecting the file that you've selected, and I'd agree. But I don't know of *any* browser that does that, and even in browsers that let you edit the path field, I don't think that's an obvious method.

So, I suggest that when JavaScript is available, Launchpad should add a "Clear" button next to any file upload control, which would deselect the file in the control. (Possibly the only way to do this would to be to delete the control from the DOM entirely, and insert a new one in the same place with the same id=, name=, and other attributes except for value=.)

Then in five or ten years, if most people using Launchpad use browsers that supply an equivalent button themselves, Launchpad can stop supplying its custom buttons.

Changed in malone:
status: Invalid → New
Revision history for this message
Björn Tillenius (bjornt) wrote : Re: [Bug 257485] Re: Can't not attach a file

On Wed, Aug 13, 2008 at 06:01:05PM -0000, Matthew Paul Thomas wrote:
> So, I suggest that when JavaScript is available, Launchpad should add a
> "Clear" button next to any file upload control, which would deselect the
> file in the control. (Possibly the only way to do this would to be to
> delete the control from the DOM entirely, and insert a new one in the
> same place with the same id=, name=, and other attributes except for
> value=.)

Well, maybe. Personally I would say Won't Fix, but since it's a general
Launchpad issue, I'll let someone else decide.

description: updated
description: updated
Revision history for this message
Francis J. Lacoste (flacoste) wrote :

Well, the HTML standard has a very well supported 'reset' button for case like these, which can be also achieved by reloading the page. But I guess the rationale behind this bug is that the user doesn't want to lose the other information already entered in the page.

I agree with Bjorn, this is really a browser issue.

Changed in launchpad:
status: New → Won't Fix
Revision history for this message
Matthew Paul Thomas (mpt) wrote :

Francis, which browser do you suggest people use to avoid this problem?

Revision history for this message
Christian Reis (kiko) wrote :

TBH, I think this is one case where Matthew's suggestion is easy to implement and makes a lot of sense.

Changed in launchpad:
importance: Undecided → Medium
status: Won't Fix → Triaged
Changed in launchpad:
importance: Medium → High
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.