Solved

How to serve online vCard to iPhone and Android

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

Simple, centralized multimedia control

Watch and learn to see how ATEN provided an easy and effective way for three jointly-owned pubs to control the 60 televisions located across their three venues utilizing the ATEN Control System, Modular Matrix Switch and HDBaseT extenders.

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.
Here, we have shared an easy step by step tutorial on how to download instagram images and videos on PC, Android Mobile and iOS mobile.
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…

726 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