?
Solved

How to serve online vCard to iPhone and Android

Posted on 2011-09-23
3
Medium Priority
?
1,561 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: 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

Short answer to this question: there is no effective WiFi manager in iOS devices as seen in Windows WiFi or Macbook OSx WiFi management, but this article will try and provide some amicable solutions to better suite your needs.
How to take pictures with depth using iOS 10
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.

777 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