title: Please help me send a jpg file using send_data
body: <p>I'm using the following tags in my html.erb to both display and download a jpg file that is not in the public/images folder:</p>
  
  <pre><code>&lt;%= image_tag retrieve_photo_path(@photo) %&gt;
  &lt;%= link_to "Download Photo", download_photo_path(@photo) %&gt;
  </code></pre>
  
  <p>my controller code looks like:</p>
  
  <pre><code>def retrieve
    @photo = Photo.find(params[:id])
    send_data File.read(@photo.abs_filepath), :type = "image/jpeg", :disposition =&gt; "inline"
  end
  
  def download
    @photo = Photo.find(params[:id])
    send_file @photo.abs_filepath, :type = "image/jpeg", :filename =&gt; @photo.filename
  end
  </code></pre>
  
  <p>The download link works perfectly, but the image tag displays a red x (broken image).  What am I missing?  I'm using InstantRails on WinXP, updated to Rails 2.3.4 and Ruby 1.8.6.</p>