Ticket #5718 (closed enhancement: fixed)
Opened 5 years ago
Last modified 3 years ago
Add a direct "raw" download link to the attachments section of a ticket view.
| Reported by: | david@… | Owned by: | Marcin Wojdyr <wojdyr@…> |
|---|---|---|---|
| Priority: | normal | Milestone: | 0.11.5 |
| Component: | attachment | Version: | |
| Severity: | minor | Keywords: | attachment |
| Cc: | wojdyr@…, vz-trac@… | ||
| Release Notes: | |||
| API Changes: | |||
Description
When creating a bug ticket, our customers oftentimes attach project files that illustrate the problems. It would save our developers time to be able to download these attachments with one click (instead of a click, a scroll down, another click, and a back-button press).
Attachments
Change History
comment:1 Changed 4 years ago by cboos
- Keywords attachment added
- Milestone set to 0.12
- Owner changed from jonas to cboos
- Severity changed from normal to minor
comment:2 Changed 4 years ago by anonymous
Changed 4 years ago by tedfordgif@…
- Attachment downloadUnrenderableAttachments.patch added
Implements enhancement described in this ticket.
comment:3 Changed 4 years ago by tedfordgif@…
Actually, my patch doesn't add a new link. It instead redirects unrenderable attachments (wiki, tickets) to the raw download facility.
Changed 4 years ago by tedfordgif@…
- Attachment downloadUnrenderableAttachments.2.patch added
Added link to attachment lists to delete attachments (when permissions allow).
comment:4 Changed 4 years ago by anonymous
- Owner changed from cboos to anonymous
- Status changed from new to assigned
comment:5 Changed 3 years ago by wojdyr@…
- Cc wojdyr@… added
- Owner changed from anonymous to cboos
- Status changed from assigned to new
The attachments don't implement the feature requested in this ticket.
The two last attachments (.2.patch and .2.2.patch) are the same.
Download button would definitely improve usability, several users asked about it for wxTrac, some of them reportedly prefer to type directly URL (.../raw-attachment/...) instead of clicking and scrolling.
It seems to me that the change by anonymous user in comment 4: changed owner from cboos to anonymous was unintended, so I'm changing it back.
comment:6 Changed 3 years ago by cboos
- Milestone changed from 0.13 to 0.12
comment:7 follow-up: ↓ 8 Changed 3 years ago by anonymous
- Resolution set to fixed
- Status changed from new to closed
The patches are not required, this is a documentation bug in trac. So, this ticket should be closed:
- If you do not want "Content-Disposition: attachment" to be sent, make render_unsafe_content = true. You need to do this in the correct section, I put it in all these section: ![browser], ![wiki] and ![attachment]
- If you do not want trac to display "unknown/cannot render page, try to download" page for pdf/msword, then use attach.pdf instead of attach.pdf. You do not need to muck with the absolute URL!
It took me some time to figure these out and you don't need any plugins or patches IMHO.
comment:8 in reply to: ↑ 7 Changed 3 years ago by anonymous
Still new to trac, messed up formatting:
Use [raw-attachment:attach.pdf] instead of [attachment:attach.pdf].
comment:9 Changed 3 years ago by rblank
- Resolution fixed deleted
- Status changed from closed to reopened
Please don't close tickets as "fixed" unless you have actually committed a fix for the issue.
Changed 3 years ago by Marcin Wojdyr <wojdyr@…>
- Attachment raw-download-link.diff added
one-line patch that adds a direct raw link
Changed 3 years ago by Marcin Wojdyr <wojdyr@…>
- Attachment Screenshot.png added
screenshot - how attachment list with raw-download icons looks like
comment:10 Changed 3 years ago by Marcin Wojdyr <wojdyr@…>
comment:11 Changed 3 years ago by rblank
This looks very good IMO. Maybe the icon should be made a bit taller, and the CSS trimmed so that there is no dotted line underneath, but that's a matter of taste.
comment:12 Changed 3 years ago by VZ
- Cc vz-trac@… added
Marcin's patch is already very useful but it would be even more convenient to also have the download icon near the "attachment foo.bar added" sentence in the comments themselves and not only in the attachments frame in the top.
TIA!
Changed 3 years ago by Marcin Wojdyr <wojdyr@…>
- Attachment raw-download-link2.diff added
updated patch adding icon links in two places
Changed 3 years ago by Marcin Wojdyr <wojdyr@…>
- Attachment Screenshot.2.png added
updated screenshot
Changed 3 years ago by Marcin Wojdyr <wojdyr@…>
- Attachment raw-download-link2.2.diff added
the previous patch doesn't work, this should work
comment:13 Changed 3 years ago by Marcin Wojdyr <wojdyr@…>
rblank: I think you are right about removing underline and making the icon higher. The updated proposal, with raw attachment icons also in Change History, looks like this:

BTW this change is tested in wxTrac.
comment:14 Changed 3 years ago by rblank
Looks great!
Christian, if you don't mind, I'll integrate this shortly into 0.11-stable.
comment:15 Changed 3 years ago by cboos
- Component changed from general to attachment
- Milestone changed from 0.12 to 0.11.5
- Owner changed from cboos to Marcin Wojdyr <wojdyr@…>
- Status changed from reopened to new
I don't mind at all, I like this as well.
The only thing I'm left wondering is if we couldn't push this further and add the icon to the attachment:... TracLinks as well. I think that will be quite useful on Wiki page describing installation procedures, for example. The advantage of this upon raw-attachment:... links is that you can also easily access the attachment meta-data page (not to mention that raw-attachment: is probably lesser known that attachment:).
comment:16 Changed 3 years ago by rblank
Patch applied in [8173] with a few minor changes:
- Used a trac- prefix for the new CSS class (#5997).
- Put the CSS into trac.css, as wiki pages can also have attachments.
- Hide the icon when printing.
- Changed the alt= of the image to the same text as the link title, as IE displays the alt text.
- Converted the image to .png as most of our images are in that format.
Thanks for the excellent patch!
Next, I'll test the idea in comment:15 to add the icon to attachment: links as well.
Changed 3 years ago by rblank
- Attachment 5718-download-link-all-r8173.patch added
Patch adding a download icon to all links to attachments.
comment:17 follow-up: ↓ 18 Changed 3 years ago by rblank
The patch above adds a download icon to all attachment: links. I think it's a nice addition. I'm not quite sure about the link title, "Original format" (the same as in the list of attachments) is not quite descriptive. Maybe I should change it to "Download".
Opinions?
comment:18 in reply to: ↑ 17 Changed 3 years ago by Marcin Wojdyr <wojdyr@…>
Replying to rblank:
The patch above adds a download icon to all attachment: links. I think it's a nice addition. I'm not quite sure about the link title, "Original format" (the same as in the list of attachments) is not quite descriptive. Maybe I should change it to "Download".
FWIW I agree, "Download" seems to be a better name (also in the list of attachments)
Changed 3 years ago by cboos
- Attachment attachment-trac-links.png added
sample of Wiki content with attachment: links, using latest patch
comment:19 Changed 3 years ago by cboos
comment:20 Changed 3 years ago by rblank
- Resolution set to fixed
- Status changed from new to closed
Added the download icon to all attachment: links in [8174].
comment:21 Changed 3 years ago by cboos
Cool, thanks!






#6132 was closed as duplicate.