Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to serve online vCard to iPhone and Android

Posted on 2011-09-23
3
Medium Priority
?
1,607 Views
Last Modified: 2012-05-12
I have published vcards on my apache web server. I have written a php script to read the vcards and serve them with the proper headers:

header('Content-Type: text/x-vCard; name='.$file);
header('Content-Description: vCard');
header('Content-Disposition: inline; filename= '.$file);
header('Content-Length: '.filesize($path.$file));
readfile($path.$file);

Open in new window


This codes works well for BlackBerry phones but on Android phones it displays the vcard source code in the browser as text and on the iPhone I get the message "Safari cannot download this file."

I'm not opposed to parsing the vcard files and delivering the information in a different format if someone knows of a format that works for all. I suppose I could do some type of OS detection and deliver the information in different formats, too.

Has anyone successfully hosted vCard files for multiple devices? Any suggestions?
0
Comment
Question by:Kim Walker
  • 2
3 Comments
 
LVL 3

Accepted Solution

by:
woepwobin earned 2000 total points
ID: 36587438
Try this (from roundcube code):

header('Content-Type: text/x-vcard; charset=UTF-8');
header('Content-Disposition: attachment; filename="'.$file.'"');
readfile($path.$file);

Open in new window

0
 
LVL 22

Author Comment

by:Kim Walker
ID: 36587589
This may have fixed the Android problem. It now downloads the file in the background and I can load the contact from the download as soon as I discover it was downloaded. It'd be nice if it automatically switched to the download screen and prompted me to load it, but, hey, it works.

No joy on the iPhone, though. Still cannot download the file.

I'll have to check with a friend to see if the BlackBerry still works. I'll get back to you.
0
 
LVL 22

Author Closing Comment

by:Kim Walker
ID: 37027489
I still don't have a solution for iPhone.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There is a lot to be said for protecting yourself and your accounts with 2 factor authentication.  I found to my own chagrin, that there is a big downside as well.
Learn how to use the free Acronis True Image app to easily transfer data between iPhones and Android phones.
This video is in connection to the article "The case of a missing mobile phone (https://www.experts-exchange.com/articles/28474/The-Case-of-a-Missing-Mobile-Phone.html)". It will help one to understand clearly the steps to track a lost android phone.
This video demonstrates how to sync Microsoft Exchange Public Folders with smartphones using CodeTwo Exchange Sync and Exchange ActiveSync. To learn more about CodeTwo Exchange Sync and download the free trial, go to: http://www.codetwo.com/excha…

877 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question