title: Rails, Paperclip; Validate Attachment
body: <p>I want validate the file content of a paperclip attachment (https://github.com/thoughtbot/paperclip).</p>
  
  <p>My model:</p>
  
  <pre><code>class PackageArchive &lt; ActiveRecord::Base
    attr_accessible :package
    has_attached_file :package
  
    validates_attachment :package,
              :presence =&gt; true
    validate :open
  
    def open
      Rails.logger.debug "####" + original_filename.inspect
      file_content = `cat "#{package.path}"`
    end
  end
  </code></pre>
  
  <p>"cat" abort with error message "No such file or directory". It there a way to get the correct file name?</p>