]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/trace.rb
Avoid reading traces and trace images into memory when sending them to
[rails.git] / app / models / trace.rb
index ba255e85d4a6d1c15169a76497f32e490acbcc70..2d4e9ef8ab12381a92b22cd13d7ae2b2ca6b47cb 100644 (file)
@@ -72,6 +72,10 @@ class Trace < ActiveRecord::Base
     "/home/osm/gpx/#{id}.gpx"
   end
 
+  def mime_type
+    return `file -bi #{trace_name}`.chomp
+  end
+
   def to_xml_node
     el1 = XML::Node.new 'gpx_file'
     el1['id'] = self.id.to_s