Hey there, basically I have a list of people and their contact information in a table. Also a little icon of a vCard (MS Outlook Contact) where ideally you can click on it and download the vCard. The vCard gets generated on the fly from the person's contact info that is stored in a database (I'm working in PHP/Mysql). The vCard is just a simple text file (*.vcf) with the information 'plugged in' via PHP to the standardized vCard format.
So in my little php file (get_vcard.php) I have this
$filename = $v->getFileName();
//$output is my final, formatted text
$output = $v->getVCard();
header("Content-type: text/x-vCard; name=$filename");
header("Content-Disposition: attachment; filename=$filename");
header("Content-Length: ".strlen($output));
header("Content-Transfer-Encoding: binary");
echo $output;
This works beautifully if I type in the location of get_vcard.php in the browsers address bar- I get prompted to download a vCard. But when done the AJAX way, asynchronously, the script gets called, the response headers say it's a text/x-vCard content type but nothing happens; no prompt for a download or anything at all.
And when done in IE, it crashes. :bemused: I'd like to get this to work asynchronously, without any <iframe> workarounds.