title: Paperclip: Content Type Spoof trying to upload .gpx files
body: <p>Apologies if this has been answered and I failed to find it. Any direction would be greatly appreciated.</p>
  
  <p>Using Rails 4.1.4, Paperclip 4.2.0 and Simple Form 3.0.2.</p>
  
  <p>After <code>Submit</code>, I get <code>has an extension that does not match its contents</code> output in the form error message. </p>
  
  <p>In the server window:</p>
  
  <pre><code>Started POST "/routes" for 127.0.0.1 at 2014-08-28 15:18:25 +0700
  Processing by RoutesController#create as HTML
  Parameters: {"utf8"=&gt;"✓", "authenticity_token"=&gt;"5BCHGBkwQH4mlnTVjy/PpD53mJKJpSmBXwXT/oul7yY=", "route"=&gt;{"track_attributes"=&gt;{"gpx"=&gt;#&lt;ActionDispatch::Http::UploadedFile:0x007fa89c9cd348 @tempfile=#&lt;Tempfile:/var/folders/_g/6shs5yrj36n960wpt880ysl80000gn/T/RackMultipart20140828-42106-vi71nb&gt;, @original_filename="Serge's tracks.gpx", @content_type="application/octet-stream", @headers="Content-Disposition: form-data; name=\"route[track_attributes][gpx]\"; filename=\"Serge's tracks.gpx\"\r\nContent-Type: application/octet-stream\r\n"&gt;}, "title"=&gt;"Serge track", "description"=&gt;"loop of hang dong", "distance"=&gt;"", "total_ascent"=&gt;""}, "commit"=&gt;"Create Route"}
  Command :: file -b --mime '/var/folders/_g/6shs5yrj36n960wpt880ysl80000gn/T/f55fe48e09c9cc3ee6c6271fe94f407520140828-42106-1hgpby7.gpx'
  [paperclip] Content Type Spoof: Filename Serge's_tracks.gpx ([]), content type discovered from file command: application/xml. See documentation to allow this combination.
  (0.3ms)  BEGIN
  Command :: file -b --mime '/var/folders/_g/6shs5yrj36n960wpt880ysl80000gn/T/f55fe48e09c9cc3ee6c6271fe94f407520140828-42106-62bkvh.gpx'
  [paperclip] Content Type Spoof: Filename Serge's_tracks.gpx ([]), content type discovered from file command: application/xml. See documentation to allow this combination.
  (0.8ms)  ROLLBACK
  </code></pre>
  
  <p>I haven't been able to find said documentation in the Paperclip docs.
  Running <code>file Serge\'s\ tracks.gpx --mime-type -b</code> produces <code>application/xml</code>  </p>
  
  <p>My MVC looks like this:  </p>
  
  <pre><code>class Track &lt; ActiveRecord::Base
    belongs_to :route
    has_attached_file :gpx
    validates_attachment_content_type :gpx, :content_type =&gt; /application\/xml/
  end
  
  class Route &lt; ActiveRecord::Base
    has_one :track, dependent: :destroy
    accepts_nested_attributes_for :track
    validates :title, presence: true
  end
  </code></pre>
  
  <p>Inside <code>RoutesController</code>  </p>
  
  <pre><code>def new
    @route       = Route.new
    @route.track = Track.new
  end
  
  def create
    @route = Route.new(route_params)
  end
  
  def route_params
    params.require(:route).permit(:title, :description, :distance, :total_ascent, track_attributes: [:gpx])
  end
  </code></pre>
  
  <p>The simple_form:  </p>
  
  <pre><code>= simple_form_for @route do |r|
    = r.simple_fields_for :track do |t|
      = t.input :gpx
    = r.input :title
    = r.input :description
    = r.input :distance
    = r.input :total_ascent
    = r.button :submit
  </code></pre>