]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/trace_controller.rb
Provide a more sensible suggested filename when downloading traces.
[rails.git] / app / controllers / trace_controller.rb
index 5b1702948185a304ad31358d5d0ab9535e378264..288a4a67b676d6002f50fd1ea638ea68e5dc52b8 100644 (file)
@@ -118,7 +118,7 @@ class TraceController < ApplicationController
   def data
     trace = Trace.find(params[:id])
     if trace and (trace.public? or (@user and @user == trace.user))
-      send_file(trace.trace_name, :filename => "#{trace.id}.gpx", :type => trace.mime_type, :disposition => 'attachment')
+      send_file(trace.trace_name, :filename => "#{trace.id}#{trace.extension_name}", :type => trace.mime_type, :disposition => 'attachment')
     else
       render :nothing, :status => :not_found
     end