Hello,

I have been trying to attach a vcard file to an about_us page.

Each time I attach the .vcf file, Drupal appends .txt to the file name..

So the attached file ends up as;

myname.vcf.txt

What I would like is the ability for visitors to click the link and open the vCard in their default viewer..

I have searched for possible reasons but alas, no solutions... I thought it may be related to a vCard Cross-Site Scripting Vulnerability...

Any suggestions would be most welcome..

Thanks

Russ

Comments

darren oh’s picture

Drupal adds .txt to the names of unrecognized files as a security measure. Unfortunately, there is currently no reliable way to make Drupal recognize file types. You can find a patch to preserve file names and links to more information in issue 74542.

dean.p’s picture

Drupal 6.12

Hi, I had a problem with vcf attachments. When clicked, the content of the vcf would just show the browser as if you'd clicked a txt file. A simple fix that seems to work is just by adding the following line to your .htaccess file in the installed Drupal root folder:

AddType text/x-vcard .vcf

Sack.

dean.p’s picture

What would be good though, is if someone created a vcf module that would take the appropriate data from a contact or profile within Drupal and generate the vcf dynamically by way of a link or button (say, in an attached block) on any particular profile view or node. That way you can be sure the vcf is always up-to-date.

I attempted this myself but failed miserably... I'm yet to actually make my first module ;)

Sack