Rails file download

Recommended for you: Get network issues from WhatsUp Gold. Not end users.

Recently the file download, encountered several problems. The first code:

1 in the Linux under development, testing and practical chrome laboratory version, there is no problem, but in IE, Download excel but no suffix

Download the file 2.IE under a garbled

In fact, the main or IE because in the domestic IE is more, so it is necessary to support.

The code is modified, direct stick out:

 send_file FILE_PATH+"example.xls",
      filename:CGI::escape( "Example.Xls"),
      :type =>'application/vnd.ms-excel',:stream => true,:buffer_size => 4096

Where type used to specify download, CGI:: Escape let him show normal Chinese.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download

Posted by Barbara at November 28, 2013 - 4:42 PM