[thelist] creating and delivering a formatted document with classic asp

Sarah Adams mr.sanders at geekjock.ca
Thu Feb 22 08:49:43 CST 2007

>>> Why not just serve up a HTML file with an rtf or doc extension?
>> Would that even work? It just seems *wrong*.
> URLs aren't filenames, and thus do not have filename extensions. As long
> as the Content-Type header is text/html there is nothing non-standard
> about serving an HTML file with a URL ending in .rtf, .doc, or for that
> matter even .mp3, .gif, .jpg, or .txt, or no "extension" at all. In
> fact, some sites are served with URLs like
> http://www.example.com/my-document where the local filename is actually,
> say, my-document.txt on the local disk (see the Apache documentation for
> "Option MultiViews", which has been around since at least 1.3.x if not
> earlier).
> The only reason it *seems* wrong to you are the widespread myths that:
> 1) the URL has to map to a filename and directory path on the local disk
> (it doesn't as explained above), and 2) what would be the filename
> extension on the URL if it was a filename identifies what is at that URL
> (it doesn't, Content-Type does).

No, I think it seems wrong to me because I think the file extension in
the URL has anything to do with the actual type of the file. I just
don't see how simply changing the Content-Type header of a file from
text/html to text/rtf is going to make the file actually *be* an RTF
file. I can call an apple an orange all I want, but it is still an
*apple*. For example, I could serve up, as suggested, an .mp3 with
text/rtf Content-Type header, but that doesn't mean Word will be able to
open the file and display anything meaningful.

Unless I'm missing something (and please, let me know if I am!), this
still seems wrong to me.

sarah adams
web developer & programmer
portfolio: http://sarah.designshift.com
blog: http://hardedge.ca

More information about the thelist mailing list