Downloading the files shows data instead of download box.

V

Vamsi Krishna

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.


[email protected]
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.
 
B

Brian Candler

Vamsi said:
send_data content, :type=>'application/octet-stream', :disposition =>
'attachement', :x_sendfile => true

Probably you need 'attachment' not 'attachement'

That looks like a Rails method to me. Rails methods would be best asked
on a Rails mailing list. (Ruby != Rails)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top