Search code examples
asp.net-mvcmodel-view-controllerfile-typevcf-vcard

Set file save type on vcard in MVC


I created an MVC page which returns a vCard (Response.ContentType = "text/vcard";). The param that I pass in on the URL route is the user's account name (the first part of their e-mail address). When I hit the page, I get a dialog box prompting to save the file, but the file type of the Save dialog box is also the user's account name, when it should be .VCF. How can I set the default file type in the Save dialog box to be .VCF?

Thanks, Jay


Solution

  • Set Content-Disposition to attachment; filename=SOmeName.vcf