send_data/send_file does not open a save as dialog box

245 views
Skip to first unread message

ryepie

unread,
May 31, 2012, 2:29:04 PM5/31/12
to Ruby on Rails: Talk
Hello,

We are using JRuby 1.5.1/ruby 1.8.7/Rails 2.3.8 with a GWT front end.

I'm having an issue when attempting to send a server side .csv file to
the user using rails send_file.

my code is:

send_file(path_to_file, type=>'text/csv')

While this is returning fine with an http status of 200, the client
side save as dialog is never opening for the user to receive the file.
Any ideas why this isn't working?



ray

unread,
Jun 18, 2012, 5:51:30 PM6/18/12
to Ruby on Rails: Talk
same problem. save_file fails. no user dialog box to open or save the
file.

send_file(path, :type => "application/pdf", :disposition => "inline" )

works in Rails 2
fails in Rails 3 with Activescaffold and webrick or thin.

I am also interested in any ideas why this isn't working?

Frederick Cheung

unread,
Jun 19, 2012, 10:19:24 AM6/19/12
to Ruby on Rails: Talk


On Jun 18, 10:51 pm, ray <rnevi...@eircom.net> wrote:
> same problem. save_file fails. no user dialog box to open or save the
> file.
>
> send_file(path, :type => "application/pdf", :disposition => "inline" )
>
> works in Rails 2
> fails in Rails 3 with Activescaffold and webrick or thin.
>

inline means that the browser will try and display inline if it can -
I'd try attachment instead

Fred
Reply all
Reply to author
Forward
0 new messages