Solved

How to serve online vCard to iPhone and Android

Posted on 2011-09-23
3
1,302 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 500 total points
Comment Utility
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 21

Author Comment

by:Kim Walker
Comment Utility
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 21

Author Closing Comment

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

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
looking for s6 galaxy with removable battery 4 80
iOS10 and Notifications 2 34
Ios10 upgrade 8 68
Apache Issues 9 44
A short article about problems I had with the new location API and permissions in Marshmallow
The case of the missing phone talks about the way a small electronic gadget (the mobile phone) has penetrated into our lives and has made us addicted to it.
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.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now