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.
Joan Bondira (jbondira -at- reesebros -dot- com) asks:
> I'm trying to build a web-based document library, and I want one of
> those download boxes to open when a user clicks a button next to a
> listed file. Can anyone tell me how to accomplish this? Can
> JavaScript do it, or do I need something else?
Strictly speaking there's no way to do this; the feature you're
talking about is not a javascript feature or like the HTML upload tag,
it's a convenience in the way your browser handles certain mime types.
Specifically, when your browser sends a request to a server, the server
responds with a set of headers, including a content-type header that
describes what the content (the part that comes after the headers)
will contain.
Your browser interprets the content-type header and based on
that, decides what to do with the content - display it in a page,
launch it in a helper application, or lacking one of the above, offer
to save it to a file for you. That's where that pop-up comes in.
It's interesting to note, however, that Internet Explorer reportedly
sometimes ignores the mime-type if it recognizes the data type on its
own (i.e. a microsoft word file).
Some common mime-types are text/plain (for text files), text/html
(for web pages), image/gif, image/jpeg, application/pdf. A mime type
that very often causes the "save as" dialog to pop up in IE is
application/octet-stream, indicating binary data.
An interesting looking table of different mime types is at:
Just for background, it's interesting to note that the requests
and responses that browsers and http servers push back and forth are
based on mime-encoding. Loosely, each request or response is a set of
headers and data, MIME-style. MIME was invented for internet mail to
support the capability to push a wide variety of types of files around
(prior to that, all mail was either plain text, or plain text
containing uuencoded (i.e. text-ified) shar files).
*** Deva(tm) Tools for Dreamweaver and Deva(tm) Search ***
Build Contents, Indexes, and Search for Web Sites and Help Systems
Available now at http://www.devahelp.com or info -at- devahelp -dot- com
TECH*COMM 2001 Conference, July 15-18 in Washington, DC
The Help Technology Conference, August 21-24 in Boston, MA
Details and online registration at http://www.SolutionsEvents.com
---
You are currently subscribed to techwr-l as: archive -at- raycomm -dot- com
To unsubscribe send a blank email to leave-techwr-l-obscured -at- lists -dot- raycomm -dot- com
Send administrative questions to ejray -at- raycomm -dot- com -dot- Visit http://www.raycomm.com/techwhirl/ for more resources and info.