I\'m trying to add a vCard from a web link to the user\'s contact list on Android 2.2. When I direct the user to .vcf file, all I get is text output in the mobile browser.
This can be used to download the file to your SD card Tested with Android version 2.3.3 and 4.0.3
======= php =========================
<?php
// this php file (example saved as name is vCardDL.php) is placed in my html subdirectory
//
header('Content-Type: application/octet-stream');
// the above line is needed or else the .vcf file will be downloaded as a .htm file
header('Content-disposition: attachment; filename="xxxxxxxxxx.vcf"');
//
//header('Content-type: application/vcf'); remove this so android doesn't complain that it does not have a valid application
readfile('../aaa/bbb/xxxxxxxxxx.vcf');
//The above is the parth to where the file is located - if in same directory as the php, then just the file name
?>
======= html ========================
<FONT COLOR="#CC0033"><a href="vCardDL.php">Download vCARD</A></FONT>