In my project, I use Carrierwave to download files like doc and pdf . In case I want to download pdf my controller,
send_file @document ,: disposition => 'inline' ,: type => 'application / pdf'
And it works great, displays the pdf file in the browser, and the URL I got is / documents / file_name , which is good too. But I want to set the header header or url header, so the browser tab displays the file_name instead of myapp.com/documents/file_name
Is there an easy way to do this?
source share