I am uploading reports, via Carrierwave, to Amazon s3, but with
protected urls. I'm able to process the upload fine, and I can see the
file on Amazon, but it renders as text. I want it to trigger a browser
download instead of just render the text.

When I was generating the file via a template, I could control the
headers and force the right download like this:

 helper_method :render_csv
  def render_csv(file, view=nil)
    filename = "export"
    filename = "user_export" if params[:action] == "process_users"
    filename ||= params[:action]
    filename += '.csv'

    (request.env['HTTP_USER_AGENT'] =~ /msie/i) ?
set_ie_headers( filename ) : set_headers( filename )
    render :layout => false, :action => view
  end


But now, I'm downloading from s3.

Any suggestions?

-- 
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to heroku@googlegroups.com.
To unsubscribe from this group, send email to 
heroku+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.

Reply via email to