Edgewall Software

Opened 15 years ago

Last modified 8 years ago

#6014 new enhancement

Pre/Post processing of the attachments (compression,virus-check,etc)

Reported by: florianseydoux@… Owned by:
Priority: lowest Milestone: unscheduled
Component: attachment Version:
Severity: minor Keywords: attachment compression
Cc: mmitar@… Branch:
Release Notes:
API Changes:
Internal Changes:


I would be so happy if it was possible to specify some pre/post-storing processing, launched when a new attachment is made (to a ticket or a wiki) - and similarly, some pre-reading process, of course.

My goal is to save some disk-space on the server (ok, I know - disk are cheap now, but…) by doing a simple bzip on the attached files (and the reverse operation when the files are read)…
(users of my trac site have to regularly provide large logs with their tickets, but I can't ask them to do some compression before (specially with such strange things like bzip): they are not computer scientist, and they are quite impatient persons !)

But such feature can also be used for other purpose… like virus detection?

Attachments (0)

Change History (12)

comment:1 by Noah Kantrowitz, 15 years ago

Virus detection should already be possible with the same hooks the spam filter system uses. As for full inbound and outbound filtering, that may be a bit much.

comment:2 by Christian Boos, 15 years ago

Keywords: attachment compression added; ATTACHMENT COMPRESSION removed
Milestone: not applicable2.0

I think it's a good idea, we already have an IAttachmentManipulator interface where this could be added.

There's already a prepare_attachment method there, which is not yet used:

    def prepare_attachment(req, attachment, fields):
        """Not currently called, but should be provided for future

This could be replaced by:

    def encode_attachment(req, attachment, fileobj):
        """Filter in the `fileobj` before it gets written to the disk.
        Returns another file object (eventually `fileobj` if there's no encoding)

    def decode_attachment(req, attachment, fileobj):
        """Filter out the `fileobj` to retrieve its initial unencoded form."""

comment:3 by anonymous, 15 years ago

Resolution: fixed
Status: newclosed

comment:4 by Emmanuel Blot, 15 years ago

Resolution: fixed
Status: closedreopened

comment:5 by Piotr Kuczynski <piotr.kuczynski@…>, 15 years ago

Component: ticket systemattachment

comment:6 by mmitar@…, 14 years ago

Cc: mmitar@… added

One other use for preprocessing would be an option when uploading attachments to automatically generate thumbnail versions of images uploaded. So system would have to be able to add multiple attachments with just one upload.

In this way also #2141 could be implemented.

comment:7 by Christian Boos, 13 years ago

Milestone: 2.0unscheduled

Milestone 2.0 deleted

comment:8 by Mitar, 13 years ago

Ping? It would be great to have this functionality so that thumbnail versions of images would be possible. What is missing for this to be used?

comment:9 by Christian Boos, 12 years ago

Milestone: triagingunscheduled

Milestone triaging deleted

comment:10 by Ryan J Ollos <ryan.j.ollos@…>, 10 years ago

Cc: ryan.j.ollos@… added

comment:11 by Ryan J Ollos, 9 years ago

Cc: ryan.j.ollos@… removed

comment:12 by Ryan J Ollos, 8 years ago

Owner: Jonas Borgström removed
Status: reopenednew

Modify Ticket

Change Properties
Set your email in Preferences
as new The ticket will remain with no owner.
The ticket will be disowned.
as The resolution will be set. Next status will be 'closed'.
The owner will be changed from (none) to anonymous. Next status will be 'assigned'.

Add Comment

E-mail address and name can be saved in the Preferences .
Note: See TracTickets for help on using tickets.