Last Updated: February 25, 2016
·
706
· nick-desteffen

Paperclip 4.0 File Detection

Paperclip 4.x includes automatic file content type detection:
https://github.com/thoughtbot/paperclip#security-validations

If you want to include detection of newer Microsoft Office and OpenOffice XML formatted documents you may need to upgrade the file utility which Paperclip runs. My version of OSX (Mountain Lion) was running 5.04. If you don't update the office documents will be detected as zip files.

The latest version can be found at:
ftp://ftp.astron.com/pub/file

wget ftp://ftp.astron.com/pub/file/file-5.19.tar.gz
tar -xzvf file-5.19.tar.gz
cd file-5.19
./configure
make
sudo make install