6.0.0-alpha10
▾
Tasks
New Task
Search
Photos
Wiki
▾
Tickets
New Ticket
Search
dev.horde.org
Toggle Alerts Log
Help
5/15/25
H
istory
A
ttachments
C
omment
W
atch
Download
Comment on [#15056] Wrong MIME type on address book exports
*
Your Email Address
*
Spam protection
Enter the letters below:
. ..__ . .. ..__. | || \| || |[__] |/\||__/|__||/\|| |
Comment
> When employing Turba's Import/Export feature to export an address > book using the vCard format (either version 2 or 3), the downloaded > file's MIME type is wrong. The HTTP header will be > > Content-Type: text/calendar > > when it should be > > Content-Type: text/vcard > > While a wrong MIME type normally is not the most important thing on > earth, it can have some undesired results. When this is combined with > "no browser sniffing" headers (i.e. "X-Content-Type-Options: > nosniff"), some browsers will not simply adopt the filename suggested > by the "Content-Disposition" header's filename field, which would > read "contacts.vcf" in this case. Instead, the browser will suggest > saving the file as "contacts.ics" because it has been declared an > iCalendar file (text/calendar). This in turn will be irritating for > non-tech-savvy users, as a file with this name will not be > automatically imported by a local contact management software. > > The reason for the wrong MIME type seems to be that the > "Horde_Data_Vcard" class inherits directly from "Horde_Data_Imc". The > Horde_Data_Imc's "exportFile" method always uses the "text/calendar" > MIME type when making files available for download. > > I saw in the neighboring Horde_Data_Csv class that there is a field > called "_contentType" which may allow not to duplicate > Horde_Data_Imc's exportFile method for use with Horde_Data_Vcard, but > merely adjust the MIME type when downloading. However, my practical > knowledge of PHP's object model and is not sufficient to actually > make use of non-duplicated code here. As a result, the attached patch > is probably not the right way to do it, but it does solve the problem > at hand.
Attachment
Watch this ticket
N
ew Ticket
M
y Tickets
S
earch
Q
uery Builder
R
eports
Saved Queries
Open Bugs
Bugs waiting for Feedback
Open Bugs in Releases
Open Enhancements
Enhancements waiting for Feedback
Bugs with Patches
Enhancements with Patches
Release Showstoppers
Stalled Tickets
New Tickets
Horde 5 Showstoppers