Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

On my company's website, we have various professionals listed with links to download their vcard. We want to include a link to the vcard in email signatures, however when clicking a link to a vcard contained in an email doesn't work in IE (IE displays a "cannot download" error).

I've inspected the response from the webserver using Fiddler, and the vcard response is exactly the same when viewing the link on our website vs clicking the link in an email. Also confirmed that copy/pasting the link to a vcard into IE's address bar yields the same error as clicking the link in an email - IE won't open it.

It almost seems as though IE can't open a vcard unless you click a link (on a website) to the vcard. Going directly to the vcard doesn't work.

EDIT: We're seeing this issue with IE7 and IE8 only. Vcards open consistently with Firefox or Chrome.

The server response is shown below (edited to remove personal identifying info). I ran a diff between successful and failed responses in Fiddler and the only difference was the timestamp in the Date and REV fields.

HTTP/1.1 200 OK
Cache-Control: no-cache, no-store
Date: Mon, 20 Dec 2010 21:16:43 GMT
Pragma: no-cache
Content-Length: 495
Content-Type: text/x-vcard; charset=utf-8
Expires: -1
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
X-AspNet-Version: 2.0.50727
Set-Cookie: website#lang=en; path=/

BEGIN:VCARD
VERSION:2.1
N;LANGUAGE=en:LastName;FirstName;E.;;
FN:FirstName E. LastName
ORG:Company Name, LLP
TITLE:Attorney
TEL;PREF;WORK;VOICE:+1 999.999.9999
TEL;PREF;WORK;FAX:+1 999.999.9999
ADR;WORK;PREF:;;Suite 9999, 5555 Somewhere Street;Atlanta;GA;30309-4528;USA
URL;WORK:http://www.website.com
EMAIL;PREF;INTERNET:PERSON@Website.com
NOTE;ENCODING=QUOTED-PRINTABLE:Bar Admission(s) - Georgia (1900); Kentucky (1900)=0D=0A
REV:20101220T211643Z
END:VCARD
share|improve this question
1  
Can you add a little bit more details to question, like which IE version are you testing and how does it behaves with other browsers (Firebug or Live HTTP headers also can help to seeing webserver responses)... –  Dave Dec 20 '10 at 22:29
    
Thanks, I've added more info –  Bob Black Dec 21 '10 at 13:42
    
What is the exact error message you are getting? Because I can download vcards just fine in IE8 when I copy-and-paste the URL. –  Lèse majesté Dec 21 '10 at 14:22
    
The exact error message is: "Internet Explorer cannot download [WebPage].aspx from www.website.com. Internet Explorer was not able to open this Internet site. The requested site is either unavailable or cannot be found. Please try again later." –  Bob Black Dec 21 '10 at 15:17
    
One quick question, what happen if you have the vcard in a vcf file saved on local machine and try to open it with a double click? I mean, is your testing machines correctly set to handle those kind of responses? –  Dave Dec 21 '10 at 15:27
show 1 more comment

1 Answer

up vote 3 down vote accepted

I think you can workaround this with a better HTTP headers manipulation.

I'm still not sure what you are trying to do, but I think you can use HTTP headers to force and ensure the desired behavior.

If you want a vcard to be downloaded and processed by IE or Outlook, first, provide them as a .vcf file - you can generate them on the fly, or generate them from a script and keep cached.

Then you can handle vcards to be replyed with HTTP headers:

Content-Disposition: attachment; filename=personName.vcf
Content-Type: text/x-vcard; charset=utf-8; name=personName.vcf

Once the file is provided with correct MIME type and with a valid filename and so on, client's machine will process them as they are intended to interpret.

The unique issue since those measures are taken is if client machine does not have any relation to process that mime and extension (ie, Windows hasn't this configuration set).

I just tried this with IE8, on http://www.haraldjoergens.com/ (see the footer). It worked nice.

share|improve this answer
    
I think you may be onto something there. –  Bob Black Dec 21 '10 at 15:19
    
I added the name=filename.vcf to the content-type, and that seems to have done the trick. This is a Sitecore site, which isn't setup to use IIS Integrated Pipeline mode, so I can't add the Content-Disposition header, but it seems to be working fine anyway. Many thanks. –  Bob Black Dec 21 '10 at 15:39
    
+1, Dave. Yes, Bob, this is the answer to your problem. –  Chris Adragna Dec 21 '10 at 15:40
    
Alright, I'm glad that solved your problem. –  Dave Dec 21 '10 at 15:43
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.