[asterisk-dev] Mantis - how to browse patches on-screen?

Tony Mountifield tony at softins.clara.co.uk
Fri Aug 24 16:53:23 CDT 2007


In article <fanfk3$4e3$1 at softins.clara.co.uk>,
Tony Mountifield <tony at softins.clara.co.uk> wrote:
> In article <20070824194836.GA16763 at griever.vanbaak.info>,
> Michiel van Baak <michiel at vanbaak.info> wrote:
> > On 16:43, Fri 24 Aug 07, Tony Mountifield wrote:
> > > In the previous version of Mantis on the bug tracker it was possible to
> > > click on the link for an attached file such as a patch, and for it to
> > > be displayed in the same browser window as a text file.
> > > 
> > > Now that doesn't seem possible - all attached files call file_download.php
> > > which forces an Open/Save dialog. This is much less convenient for browsing.
> > > 
> > > Is there any way to go back to the old behaiour?
> > 
> > If I click on the patch filename it shows in my browser.
> > If I click the little ^ after the filename it shows an
> > Open/Save dialog.
> > Tested with firefox and opera.
> 
> Hmm, that's interesting, I've just tried Firefox and it behaves just as
> you say. I then tried IE6 on another machine and it does the same.
> 
> So I wonder why IE7 just gives me an open/save dialog box, not for
> the attachment, but for file_download.php itself! And if I click on
> "Open", it starts up Dreamweaver!

Having had a play with a test example, I've found the problem with IE7.
It needs a small change to file_download.php in Mantis.

When file_download.php receives the query parameter "download", it adds
a header:

Content-Disposition: attachment; filename="thefilename"

When the download parameter is not present, no Content-Disposition header
is currently added. For compatibility with IE7, the PHP script needs to
supply the header:

Content-Disposition: inline; filename="thefilename"

This tells IE7 to display the text/plain data on the screen, and is the
only way to make it honour the Content-Type in preference to the file
extension (.php).

Note that the filename part is still required; without it, the problem
still occurs.

If the above change could be added to file_download.php in Mantis, that
would make things a lot more convenient for those of us not fully weaned
off IE7 yet :-)

Cheers
Tony
-- 
Tony Mountifield
Work: tony at softins.co.uk - http://www.softins.co.uk
Play: tony at mountifield.org - http://tony.mountifield.org



More information about the asterisk-dev mailing list