[rt-users] compress large attachments after the fact

Jesse Vincent jesse at bestpractical.com
Wed Jan 11 11:19:30 EST 2006


On Tue, Jan 10, 2006 at 10:35:10AM -0500, Kevin Murphy wrote:
> I'd like to write a perl script to go through the RT database and 
> replace large file attachments with compressed versions of the same.  
> Just in case: as anybody done this already?  Presumably a filename field 
> and a mime type field will need to be changed, in addition to the 
> content of the attachment ....


Have a look at how we handle base64 encoding attachments for Postgres. I
bet you could implement a gzip handler that worked the same. Then you'd
just have to update the content-encoding field and add encoder/decoders.
If you get the encoder/decoder stuff working, I'd love to see it. (And
really, a flag for "gzip non-text attachments over n kilobytes on
insert) would be very cool in core.


> Thanks,
> Kevin Murphy
> 
> _______________________________________________
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
> 
> Be sure to check out the RT Wiki at http://wiki.bestpractical.com
> 
> Download a free sample chapter of RT Essentials from O'Reilly Media at 
> http://rtbook.bestpractical.com
> 
> WE'RE COMING TO YOUR TOWN SOON - RT Training in Amsterdam, Boston and
> San Francisco - Find out more at 
> http://bestpractical.com/services/training.html
> 

-- 



More information about the rt-users mailing list