X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/01cfcbd845c5d8d33f83bb22a24cf35932da2e29..a187c759b7d96be951e1667080c6e24e2288f166:/app/controllers/trace_controller.rb diff --git a/app/controllers/trace_controller.rb b/app/controllers/trace_controller.rb index fcf66dac1..541e0f840 100644 --- a/app/controllers/trace_controller.rb +++ b/app/controllers/trace_controller.rb @@ -107,7 +107,7 @@ class TraceController < ApplicationController @trace.timestamp = Time.now if @trace.save - saved_filename = "/tmp/#{@trace.id}.gpx" + saved_filename = "/home/osm/gpx/#{@trace.id}.gpx" File.rename(filename, saved_filename) logger.info("id is #{@trace.id}") @@ -115,14 +115,15 @@ class TraceController < ApplicationController redirect_to :action => 'mine' else # fixme throw an error here - # render :action => 'mine' + redirect_to :action => 'mine' + flash[:notice] = "You haven't entered a tag or a description for yoru traces." end end def data trace = Trace.find(params[:id]) if trace.public? or (@user and @user == trace.user) - send_data(File.open("/tmp/#{trace.id}.gpx",'r').read , :filename => "#{trace.id}.gpx", :type => 'text/plain', :disposition => 'inline') + send_data(File.open("/home/osm/gpx/#{trace.id}.gpx",'r').read , :filename => "#{trace.id}.gpx", :type => 'text/plain', :disposition => 'inline') end end @@ -187,7 +188,7 @@ class TraceController < ApplicationController @trace.timestamp = Time.now if @trace.save - saved_filename = "/tmp/#{@trace.id}.gpx" + saved_filename = "/home/osm/gpx/#{@trace.id}.gpx" File.rename(filename, saved_filename) logger.info("id is #{@trace.id}") flash[:notice] = "Your GPX file has been uploaded and is awaiting insertion in to the database. This will usually happen within half an hour, and an email will be sent to you on completion."