PDA

View Full Version : About VCF


anandraj
04-10-2003, 08:09 AM
Hi all,
In my application i want to give the option of downloading the file with *.vcf*
I have to open the this file where it is going to ask for save to the user. I have tried it with the content-type.
I have added the below code in the HTML file.
<meta content-type="text/x-vcard">
But still it is showing the text in the Browser instead it ihas to ask for the save dialog box.
Can any body give a idea of how can i do this.

Thanks and Regards
Anandraj.A.

Mhtml
04-10-2003, 02:23 PM
I don't think it can be done client side.

Can you use a server side language? CGI, ASP, PHP, JSP?

Weirdan
04-10-2003, 02:41 PM
application/x-vcard ?

Mhtml
04-11-2003, 12:47 PM
I think you have to set disposition="attachment; filename=yourfile.vcf" as well but as far as I know you can't do that with meta tags and it has to be set before the html is parsed.

brothercake
04-11-2003, 05:25 PM
I have a little PHP script that prompts for download of any kind of file.

<?

$saveName = stripslashes($HTTP_GET_VARS["name"]);
$savePath = stripslashes($HTTP_GET_VARS["path"]);

header ("Content-Type: application/octet-stream");
header ("Content-Disposition: attachment; filename=$saveName");
header ("Content-Transfer-Encoding: binary");
readfile($savePath);

?>

and then send it a query string with the path and filename, like

<a href="/download.php?path=contact/personal/mycard.vcf&name=mycard.vcf">