Reputation: 115
I am having some trouble downloading vcard on iphone chrome.
I making an API call from the href which returns a .vcf file to download the vcard, it is working fine on desktop (IE/Chorme/Firefox..) and working fine on iphone safari and samsung chrome,
but when i tried to download on a chrom iphone it is throwing an exception as shown in the image
Using
API bound to href is something like GET: http://.../rest/v1/profiles/00d5a2fb-ab56-a555-a5d5-0050569257ef/vcard
code to return the vcards .vcf file is something like
var vCard = BuildVCard(profile, profileUrl); vCard returns a Vcard
return new FileActionResult( new StringContent(vCard.ToString()), "text/vcard", CreateVCardFileName(profile));
and CreateVCardFileName returns a string.Format("{0}.vcf", fileName);
the entities on fiddler headers shows something like Content-Disposition: attachment; filename=Uma.vcf Content-Type: text/vcard
Is this something related to IOS- Chrome thing, do I need to add anything to download the vcard like any specific mime-types.
Appreciate your help and time.
Upvotes: 5
Views: 2315
Reputation:
I tried using this on a site. Routing to a "Please open in safari" page did work. Getting the .vcf file to download on chrome mobile by linking to the .vcf file like in the demo did not, it only brought me to a blank external page or gave me a fail like yours above.
When I put the exact live demo on my server the download to ANY phone button still did not work as the original live demo. It is my opinion that the different PHP versions the sites a running on are causing this but I could be very wrong.
How to add a contact to the iPhone's Address Book from a Web Page?
Upvotes: 2