TechWhirl (TECHWR-L) is a resource for technical writing and technical communications professionals of all experience levels and in all industries to share their experiences and acquire information.
For two decades, technical communicators have turned to TechWhirl to ask and answer questions about the always-changing world of technical communications, such as tools, skills, career paths, methodologies, and emerging industries. The TechWhirl Archives and magazine, created for, by and about technical writers, offer a wealth of knowledge to everyone with an interest in any aspect of technical communications.
A few days ago, I asked whether it was possible to configure an HTML link so
that a file (specifically a PDF in my case) would be downloaded to the
browser's hard disk (i.e., open up a "Save as" dialog) rather than launching
the helper application (in my case, the Acrobat Reader plug-in for Internet
Explorer). The goal is to make the full range of Acrobat features available
rather than forcing people to use the crippled version of Reader that runs
inside IE.
I got very few responses, but here's the summary of what I did get:
One possibility is to tell the browser that the file isn't really PDF by
changing the MIME type that the Web server sends in the header to
"application/octet-stream" (from "application/pdf "). With an Apache server,
you can put the PDF files in a special directory, and add a .htaccess file
to that directory to override the server's MIME settings. That file holds
the following command: AddType "application/octet-stream". Not sure how to
do this with Microsoft IIS.
Another possibility is to replace HTTP with FTP in the link code. In theory,
this should invoke the FTP client rather than the Reader plug-in, but it
seems too simple to work. I'll see if I can find time in the next month (if
I'm lucky) to actually try this. Feedback welcome from those who have done
so.
With a JSP-capable Web server, it should be possible to control link
behavior by tweaking the JSP settings (no details were provided). Yet
another possibility is to alter the behavior of all links on a page. One
description of this approach can be found at: http://www.javascriptkit.com/howto/htaccess9.shtml
Thanks to David Castro, John Posada, and Jim Royal for their suggestions.
(If you wrote to me and didn't get a response, it's because I didn't see
your note. Spam filters are horrid things if you have no control over how
they're configured. Sorry!)
--Geoff Hart, geoff-h -at- mtl -dot- feric -dot- ca
(try ghart -at- videotron -dot- ca if you get no response)
Forest Engineering Research Institute of Canada
580 boul. St-Jean
Pointe-Claire, Que., H9R 3J9 Canada
"I have always wished that my computer would be as easy to use as my
telephone. My wish has come true. I no longer know how to use my
telephone."--Bjarne Stroustrup (originator of C++ programming language)