You need to sign in to do that
Don't have an account?
uptime_andrew
Visualforce - Setting Content-Disposition in headers?
I know we can set the content-type header in visualforce using the contenttype attribute for <apex:page>, but can we set Content-Disposition? E.g.
Content-Disposition:attachment;filename=myfile.xls
Were you able to figure it out?
You can set that in constructor of the visualforce controller
Apexpages.currentPage().getHeaders().put('content-disposition', 'attachemnt; filename=mypdf.pdf');
or
Apexpages.currentPage().getHeaders().put('content-disposition', 'attachemnt; filename=\"'+filename+'\"');