Handle files uploaded via the API properly.
authorTom Hughes <tom@compton.nu>
Sat, 18 Aug 2007 20:49:15 +0000 (20:49 +0000)
committerTom Hughes <tom@compton.nu>
Sat, 18 Aug 2007 20:49:15 +0000 (20:49 +0000)
app/controllers/trace_controller.rb

index 2001fdb2f619a6ac38c45ab75a78e20915ef78f9..f7b56e7692ac2b844efc05930106ae951f6c2d7d 100644 (file)
@@ -203,7 +203,7 @@ class TraceController < ApplicationController
       name = params[:file].original_filename.gsub(/[^a-zA-Z0-9.]/, '_') # This makes sure filenames are sane
 
       do_create(name, params[:tags], params[:description], params[:public]) do |f|
-        f.write(request[:file].read)
+        f.write(params[:file].read)
       end
 
       if @trace.id