[thelist] link to mp4 displaying binary gibberish, not downloading

Andrew Clover and-evolt at doxdesk.com
Wed Jan 29 06:40:01 CST 2003


j.d. welch wrote:

> 1) add "AddType video/quicktime .mp4" to an .htaccess file

That should theoretically work. The problem is that browsers - IE in
particular - think they're clever, so if you click on a video link they
try to launch a media player or plug-in instead of first asking you if
you want to open or save. You can configure them not to do that, but it's
a bit of a pain, especially with IE6. Right-click-save-as should still work.

If you think users will generally want to download not play, you could try
(a) setting the returned MIME type to application/octet-stream (ie. unknown
binary file), which should always get saved, or (b) adding a 'Content-
Disposition: attachment' header to the response.

Both are a bit dodgy in various ways, but the way you're supposed to do it
is the way you're already doing it. One should really let the user decide
whether they want to play or save, but currently browsers do not make that
easy. :-(

> 2) make the link like "<a href="file.mp4" type="video/quicktime">"

That won't do anything - the 'type' here is only advisory, and gets
overridden by the real Content-Type header returned with the .mp4 file.

--
Andrew Clover
mailto:and at doxdesk.com
http://www.doxdesk.com/



More information about the thelist mailing list