Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Downloading the files shows data instead of download box.

Thread Tools

Downloading the files shows data instead of download box.

Vamsi Krishna
Posts: n/a

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.

send_data content, :type=>'application/octet-stream', :disposition =>
'attachement', _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).

Posted via

Reply With Quote
Brian Candler
Posts: n/a
Vamsi Krishna wrote:
> send_data content, :type=>'application/octet-stream', :disposition =>
> 'attachement', _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)
Posted via

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
IE shows false and Firefox shows true Gianni Javascript 3 07-10-2009 09:18 PM
Limewire & Emule: Can't download tv shows, songs download fine. lbbss Computer Support 1 01-30-2006 01:30 PM
Legally downloading TV shows etc.? Sigi Rindler Computer Support 2 08-18-2005 07:01 PM
Session var in page_load shows old value, buttonclick shows new . Whats wrong gce ASP .Net 0 05-07-2005 06:50 AM
files show as ascii instead of downloading The wee free man HTML 3 06-19-2004 02:47 AM