Solved

How to serve online vCard to iPhone and Android

Posted on 2011-09-23
3
1,427 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
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

This is an explanation of a simple data model to help parse a JSON feed
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.
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…

792 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