> *So when I tell wget to recursively scan for .mp3s it thinks it finds a
> match and downloads the "mp3" *(I also tried the Firefox plugin
> dowmthemall but it has the same effect) Does anybody have any idea how
> this sort of thing works? *
Do you know how files are mapped from extensions to meaning? There's a
mime-type mapping file. Generally, for Linux, this is /etc/mime.types.
Now, with Apache, these things are configurable:
http://httpd.apache.org/docs/2.2/mod/core.html#forcetype
The context is listed as "directory, .htaccess", so you can have a
directory which you *know* only contains HTML files, and with a simple
"ForceType text/html" in your .htaccess file, everything is sent as
HTML.
Plus, there are always CGI scripts. You can have what looks like a
directory actually map to a CGI script. When the conditions are right
perhaps things ending with .mp3 actually are sent as audio/mpeg, but
other times the extension doesn't matter, and the script is sending
"Content-Type: text/html". With that one line, it doesn't matter what
the extension is, it is advertising itself as an HTML page.
Is it annoying? You know it is. Is it straight-forward? Yeah, that too.
When it comes down to it, you just don't know what sort of content is
there without checking the headers.
Cheers,
--
Steven Black <blacks@indiana.edu> / KeyID: 8596FA8E
Fingerprint: 108C 089C EFA4 832C BF07 78C2 DE71 5433 8596 FA8E
No comments:
Post a Comment