# Zipping a file after upload, file\_column

**URL:** <https://www.ruby-forum.com/t/zipping-a-file-after-upload-file-column/112357>\
**Category:** Rails\
**Created:** [August 17, 2007, 9:05pm UTC](https://www.ruby-forum.com/t/zipping-a-file-after-upload-file-column/112357 "2007-08-17T21:05:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [August 17, 2007, 9:05pm UTC](https://www.ruby-forum.com/t/zipping-a-file-after-upload-file-column/112357/1 "2007-08-17T21:05:31Z")

</div>

I’m using file\_column and I’m not sure where to put code for zipping  
(compressing) a file.  
I want to upload an audio file, but compress it as a .zip file before  
saving.  
That way I can force downloads rather than having audio files load in  
visitor browsers.

question is: Where do put code to do the zipping, so that it occurs  
before the file is saved?  
I want the database entry to show the path to the zip file and not to  
any original.

I don’t mind if the original ends up in the temp directory that  
file\_column uses, but I don’t want the original file in the  
file\_column generated directory, I want that to be the zipped file.
