Hi

 i'm saving a file in the database( the content of file.) and i provided
an option like downloadlink. if i click on that the file should be
downloaded but it shows the content of the file on the webpage instead
of downloading.
i tried both send_file and send_data but of no use.

 and i got download box when i click on the link for an image file but i
want to download a .rb file from my app.


content=@file.content
send_data content, :type=>'application/octet-stream', :disposition =>
'attachement', :x_sendfile => true

it displays the content of the file in the webpage. even i used
send_file but not of use.

So let me know is there any secured options for downloading a file of
any extension( especially .rb).


Thanks
VamsiKrishna.
-- 
Posted via http://www.ruby-forum.com/.