Provide a more sensible suggested filename when downloading traces.

This commit is contained in:
Tom Hughes 2007-07-17 14:34:22 +00:00
parent 76df341f66
commit bce2c88336
2 changed files with 27 additions and 1 deletions

View 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