#12796 closed defect (fixed)
Can't delete a ticket attachment
| Reported by: | anonymous | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | attachment | Version: | 0.12.5 |
| Severity: | normal | Keywords: | |
| Cc: | jen917@… | Branch: | |
| Release Notes: | |||
| API Changes: | |||
| Internal Changes: | |||
Description (last modified by )
We have found that when a file with '.-' in the name is attached to a ticket, it cannot be deleted using the trac-admin command attachment remove <realm:id> <name>. In the version of trac that we are using it is difficult to understand how to delete attachments using the web interface, this is why the trac-admin command is necessary.
Attachments (0)
Change History (13)
comment:1 by , 9 years ago
| Version: | → 0.12.5 |
|---|
comment:2 by , 9 years ago
| Cc: | added |
|---|---|
| Keywords: | attachments delete '.-' added |
comment:3 by , 9 years ago
comment:5 by , 9 years ago
From your description on gmessage:trac-users:2Xflh13aTIA/RLGAhAcUAwAJ, it appears the issue is with deleting attachments using TracAdmin. I deleted the attachment through the web interface. Need to confirm if the issue is seen with TracAdmin.
comment:6 by , 9 years ago
Yes, it was command line arguments attachment remove <realm:id> <name> that I used, this was unable to recognize the file name
comment:7 by , 9 years ago
| Description: | modified (diff) |
|---|
comment:8 by , 9 years ago
| Component: | ticket system → attachment |
|---|---|
| Keywords: | attachments delete '.-' removed |
Works for me with Trac 0.12.5.
Welcome to trac-admin 0.12.5 Interactive Trac administration console. Copyright (C) 2003-2013 Edgewall Software Type: '?' or 'help' for help on commands. Trac [/var/trac/0.12-sqlite]> attachment list ticket:1 Name Size Author Date Description -------------------------------------------------------------- test.-1.txt 1 bytes admin 2017-05-06 02:31:17 Trac [/var/trac/0.12-sqlite]> attachment remove ticket:1 test.-1.txt Trac [/var/trac/0.12-sqlite]> attachment list ticket:1 Name Size Author Date Description -------------------------------------
comment:10 by , 9 years ago
> attachment list ticket:1729 Name Size Author Date Description -------------------------------------------------------------------------------------------------- J.Electrochem.Soc.-1998-Laycock-1101-8.2.pdf 2.2 MB admin 2017-05-05 10:22:01 > attachment remove ticket:1729 J.Electrochem.Soc./-1998/-Laycock/-1101/-8.pdf ResourceNotFound: Attachment 'ticket:1729: J.Electrochem.Soc./-1998/-Laycock/-1101/-8.pdf' does not exist.
This is what mine looks like when I attempt to remove it. I have tried multiple variations of the name and escape characters. My apologies for the messy comment before
follow-up: 12 comment:11 by , 9 years ago
I also tried no / escape characters and also tried with \ as an escape character, none of thos combinations worked
> attachment remove tickets:1729 J.Electrochem.Soc.-1998-Laycock-1101-8.pdf ResourceNotFound: Attachment 'tickets:1729: J.Electrochem.Soc.-1998-Laycock-1101-8.pdf' does not exist.
comment:12 by , 9 years ago
Replying to Jenna Neiser <jen917@…>:
I also tried no / escape characters and also tried with \ as an escape character, none of thos combinations worked
The / is not an escape character.
> attachment remove tickets:1729 J.Electrochem.Soc.-1998-Laycock-1101-8.pdf ResourceNotFound: Attachment 'tickets:1729: J.Electrochem.Soc.-1998-Laycock-1101-8.pdf' does not exist.
Your attachment list ticket:1729 command lists J.Electrochem.Soc.-1998-Laycock-1101-8.2.pdf, not J.Electrochem.Soc.-1998-Laycock-1101-8.pdf.
Try:
attachment remove tickets:1729 J.Electrochem.Soc.-1998-Laycock-1101-8.2.pdf
You could use TAB key to complete filename in attachment remove <realm:id> command.
comment:13 by , 9 years ago
I can't believe it was such a silly mistake on my part… Thank you so much, goes to show a second set of eyes is always valuable.
comment:14 by , 9 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |



I just deleted your attachment, so presumably the issue is fixed in a more recent Trac version.