Roundcube-Plugin-Attachment-Preview is a project mainly written in PHP and JAVASCRIPT, it's free.
Preview Attachment of Roundcube Mail