Opened 17 years ago
Last modified 10 years ago
#6014 new enhancement
Pre/Post processing of the attachments (compression,virus-check,etc)
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | lowest | Milestone: | unscheduled |
Component: | attachment | Version: | |
Severity: | minor | Keywords: | attachment compression |
Cc: | mmitar@… | Branch: | |
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
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 , 17 years ago
comment:2 by , 17 years ago
Keywords: | attachment compression added; ATTACHMENT COMPRESSION removed |
---|---|
Milestone: | not applicable → 2.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 compatibility."""
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 , 17 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:4 by , 17 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
comment:5 by , 17 years ago
Component: | ticket system → attachment |
---|
comment:6 by , 16 years ago
Cc: | 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:8 by , 14 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:10 by , 12 years ago
Cc: | added |
---|
comment:11 by , 11 years ago
Cc: | removed |
---|
comment:12 by , 10 years ago
Owner: | removed |
---|---|
Status: | reopened → new |
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.