Reputation: 975
This link works EVERYWHERE: https://www.autobackoffice.com/vcard.php
And this is the content of the file:
<?php
header('Content-Type: text/x-vcard; charset=utf-8;');
header('Content-Disposition: attachment; filename=vcard.vcf"');
echo "BEGIN:VCARD\n";
echo "VERSION:3.0\n";
echo "N:My Name\n";
echo "FN:Yet another Name\n";
echo "URL:https://www.google.com\n";
echo "ORG:Organization\n";
echo "EMAIL:[email protected]\n";
echo "PHOTO;VALUE#URI;TYPE#JPG:https://www.autobackoffice.com/mv/media/logohp.jpg\n";
echo "TEL;TYPE=voice:1234567890\n";
echo "ADR;TYPE#WORK,PREF:;;Long Way Avenue\n";
echo "REV:2022-01-26T12:13:14Z\n";
echo "END:VCARD\n";
?>
But if I simply "embed it" here:
<a href='vcard.php' download='test.vcf'>Click to download</a>
then it doesn't work on iPhone/Safari.
You can test it here: https://www.autobackoffice.com/vcard2.php
The content of vcard2.php is EXACTLY that single a href
line above.
Upvotes: 2
Views: 707