title: Rails sends 0 byte files using send_file
body: <p>I can't get send_file(Model.attachment.path) to work.
  It doesn't fail, instead, it sends a 0 byte size file to the client, the file names are correct though.</p>
  
  <p>This problem started happening after I did a big migration from Rails 2.3.8 to 3.</p>
  
  <p>There were a lot of other things that took place in this migration and I will try my best to detail all of them.</p>
  
  <ol>
  <li>Distrubution change/Server Change. Rackspace RHEL5 to Linode Ubuntu 10.04LTS</li>
  <li>Ruby version change, 1.8.6 -> 1.9.2</li>
  <li>Rails version change, 2.3.8 -> 3.0.0</li>
  <li>httpd platform change, apache2 -> nginx (However I tried on apache2 as well and it did not work).</li>
  </ol>
  
  <p>I moved the attachments via ftp as they were not part of my git repositories so they were published via cap deploy, instead manual ftp remote(RHEL5) to local(Win7) then local(Win7) to remote(Ubuntu10).</p>
  
  <p>I do know that FTPing does not retain the file permissions through the transfers, so what I've also done is mimicked the chmods that were seen on my previous servers so they are almost identical. (users/groups are different, set to root:root instead of olduser:olduser).</p>
  
  <p>A snippet of the request to download a attachment from my production log.</p>
  
  <pre><code>Started GET "/attachments/replies/1410?1277105698" for 218.102.140.205 at 2010-09-16 09:44:31 +0000
    Processing by AttachmentsController#replies as HTML
    Parameters: {"1277105698"=&gt;nil, "id"=&gt;"1410"}
  Sent file /srv/app/releases/20100916094249/attachments/replies/UE0003-Requisition_For_Compensation_Leave.doc (0.2ms)
  Completed 200 OK in 78ms
  </code></pre>
  
  <p>Everything's okay. Let me also rule out local issues, I've tried downloading via Chrome on both Win7 and Ubuntu (on Vbox).</p>
  
  <p>Let me also assure you that the path is indeed correct. </p>
  
  <pre><code>root@li162-41:/srv/app/current# tail /srv/app/releases/20100916094249/attachments/replies/UE0003-Requisition_For_Compensation_Leave.doc
  #
      #
           %17nw
                   HQ��+1ae����
                                               %33333333333(��QR���HX�"%%��@9
  ��@�p4��#P@��Unknown������������G��z �Times New Roman5��Symbol3&amp;�
                         �z �Arial5&amp;�
  </code></pre>
  
  <p>So to sum up the question, how do I get send_file to actually send files instead of fake 0 byte junk.</p>