2

I've created vcf file and upload it to my website. When I press the download button that I created "save contact" instead of saving it to contacts it opens it like that:

BEGIN:VCARD
VERSION:2.1
N:John;Doh;;;
FN:John Doh
TEL;CELL:+99999999
EMAIL;WORK:ben@gmail.com
ADR;HOME:;;Las Vegas; Nevada;USA;;
END:VCARD

Now the unclear thing is that if I send the vcf file to my gmail and press the download button it's asking me if I want to save it as contact.

Why there is a difference? and what do I need to do in order to be able to save it to contacts by clicking save contact from my website?

Thanks

RBZ
  • 173
  • 2
  • 9
  • 1
    Do you have a MIME Type defined on the web server for .vcf? When you say gmail, do you mean the Android App or the web interface? Both will try and store it to your contacts as Gmail has sort of a database of your contacts versus unique card files. – Twisty Nov 30 '12 at 00:18
  • http://stackoverflow.com/questions/4381766/how-to-get-a-vcard-vcf-file-into-android-contacts-from-website – Twisty Nov 30 '12 at 00:19

1 Answers1

1

When you download the vCard from your website, the web server is probably not assigning the correct Content-Type to the vCard file.

Try configuring your web server to assign a content type of text/vcard to files with a vcf extension. If that content-type doesn't work, try some of the ones found on the vCard Wikipedia page.

Michael
  • 34,873
  • 17
  • 75
  • 109