[gollem] MIME type with file download
Etienne Goyer
etienne.goyer at linuxquebec.com
Wed Oct 1 05:47:31 PDT 2003
On Tue, Sep 30, 2003 at 05:39:58PM -0500, Eric Rostetter wrote:
> Quoting Chuck Hagenbuch <chuck at horde.org>:
>
> > Quoting Etienne Goyer <etienne.goyer at linuxquebec.com>:
> >
> > > Is there a mecanism by which we could determine the file's MIME type,
> > > and set the header accordingly ?
> >
> > Our MIME_Magic:: package should do it.
> >
> > -chuck
>
> Yes, but then the browser would open the file if it knows the type, rather
> than downloading it as intended...
This is a policy decision, but would'nt it be better if we would let the
browser make a decision about how to handle a file ? For example, in
our setup, Gollem is used as a front-end for the management of personnal
web space. Right now, there is no way (or is there ?) for the user to
see the file inline. A user could wonder what is the file A056838.jpg,
click to see it and use the Back button to go back to file management
view. In Mozilla, currently it automatically pop up a Save dialog, and
the file type is given as "Binary Executable". I know it's Mozilla's
fault to describe application/octet-stream as "Binary Executable", but
it still feel ... wrong.
A few ideas, en vrac :
- If the browser is IE, set type as application/x-msdownload to keep to
auto-download feature, but set the MIME type to something meaningful
with other browser.
- The default MIME type could be configurable in gollem/config/conf.php.
- Beside the "Download" widget, we could have a "View" widget that would
send the file along with meaningful MIME type, and keep the download
widget doing what it currently do.
Does MIME_Magic add a huge overhead ? I suppose it have to read at
least the beginning of the file.
--
Etienne Goyer Linux Québec Technologies Inc.
http://www.LinuxQuebec.com etienne.goyer at linuxquebec.com
More information about the gollem
mailing list