Return file contents with Content-type from Javascript -


i'm trying include vcard in weebly website, need return content-type header, simple attachment won't work. have found following code in php this, can't include php code on weebly, javascript:

<?php     header("content-type: text/x-vcard");     header("content-disposition: attachment; filename=\"contact.vcf\";");     echo file_get_contents("contact.vcf"); ?> 

is there way include button return in javascript?

you should able add in simple anchor tag , browsers handle it.

<a href="contact.vcf">my contact</a> 

Comments

Popular posts from this blog

jquery - How do you format the date used in the popover widget title of FullCalendar? -

Bubble Sort Manually a Linked List in Java -

asp.net mvc - SSO between MVCForum and Umbraco7 -