Lucas wrote: > I'm developing an application that requires me to save pictures to a > database with other data. I've been searching for hours and tried a > few examples, but I keep running into trouble. Can someone recommend a > working example or explain what needs to happen to make this work. > Thank you. > Here are some pieces that may help to get you started. In a controller method: ... image = params[:listing_image] File.open("#{temp_file_path}", "w") do |f| f.write(image.read) end # Invoke Imagemagick to resize (could use RMagick if desired) `convert -resize 480x360 #{temp_file_path} #{file_path}` `convert -resize 180x135 #{file_path} #{thumb_path}` File.delete(temp_file_path) ... In a view (a key is using :multipart => true in the form) ... <% form_tag({ :controller => 'image', :action => 'manage_images', :id => @container, :container => "#{@container.class.name}"}, { :id => 'editAdForm', :name => 'editAdForm', :multipart => true }) do -%> ... <%= file_field_tag('listing_image') %> ...