I’m trying to make download available through Rails.
I know there’s send_data / send_file method in rails, but they’re
streaming download so that the process serving file is kept alive.
Web hosting services usually do not allow a long-lived process and
therefore download always fails.(It’s disconnected around 2-3 minutes)
So, I want to just use http header to download file.
However, I want the file’s name to be different from the physical file
name in the server.
I know that it can be done using ‘Content-Disposition’ header.
So, I tried this…
response.header[‘content-type’] = ‘application/force-download’
response.header[‘content-disposition’] = ‘attachment; filename=“new file
however, it just redirects to the file and the download(save) dialog box
shows the physical file name, not the new file name that I want to show
What should I do to make it possible?
Thank you in advance.