title: Carrierwave how to get the file extension
body: <p>I'm developing a Ruby on Rails application that requires file uploading/downloading. For the upload part i used the gem carrierwave since it's very easy to use and flexible. The problem is: once i uploaded the file, i need to know a few things: i.e. if it's a pdf instead of downloading the file i show it inline,and the same goes for an image. How do i get the <strong>file  extension</strong> and how can i do it to <strong>send the file</strong> to a user?? Any feedback is appreciated Thanks!!</p>