Mailing List Archive

[The Trac Project] #3083: Bad handling of URLs in IE5/6 when downloading files in raw format
#3083: Bad handling of URLs in IE5/6 when downloading files in raw format
----------------------------------------------------+-----------------------
Reporter: Christophe.Muller@research.gemplus.com | Owner: jonas
Type: defect | Status: new
Priority: low | Milestone:
Component: browser | Version: 0.9.3
Severity: normal | Keywords: IE, raw, HTTP
----------------------------------------------------+-----------------------
Hello,

The problem really lies in Internet Explorer I think and not trac but the
fact that the URL for original format links would be of the form
".../file.exe?format=raw" (or any other binary type) makes IE want to save
a file called "file" without the extension, and thus... that cannot be ran
afterwards. It also happens for example when the URL is
".../file.tgz?format=raw" in which case IE renames it to "file.tar"!???! I
have tried to look for solutions on the web but could only find people
with the same problem. One of the suggestions, though, was to add to the
HTTP header a `Content-Disposition` field which forces 1) a download and
2) a filename (this HTTP feature is described in RFC 1806).

I have patched my own working copy of trac with the following code (file
`versioncontrol/web_ui/browser.py`)
in `_render_file`:

{{{
format = req.args.get('format')
if format in ['raw', 'txt']:
req.send_response(200)
if format == 'raw':
filename=node.path.split('/').pop()
req.send_header('Content-Disposition', 'attachment;' + 'filename='
+ filename)
req.send_header('Content-Type',
format == 'txt' and 'text/plain' or mime_type)
req.send_header('Content-Length', node.content_length)
...
}}}

And it seems to do the trick for IE: when clicking on raw versions, IE now
proposes to save the file with exactly the file name that we send in the
HTTP header.

I'm not sure you will want to fix IE bugs with workarounds :-) but just in
case, I fill this ticket. Thanks for the attention.

Cheers,

Christophe.

{{{=}}} Ubuntu is an ancient African word, meaning "I can't configure
Slackware". {{{=}}}

--
Ticket URL: <http://projects.edgewall.com/trac/ticket/3083>
The Trac Project <http://trac.edgewall.com/>
Re: [The Trac Project] #3083: Bad handling of URLs in IE5/6 when downloading files in raw format [ In reply to ]
#3083: Bad handling of URLs in IE5/6 when downloading files in raw format
----------------------------------------------------+-----------------------
Reporter: Christophe.Muller@research.gemplus.com | Owner: jonas
Type: defect | Status: new
Priority: low | Milestone:
Component: browser | Version: 0.9.3
Severity: normal | Resolution:
Keywords: IE, raw, HTTP |
----------------------------------------------------+-----------------------
Comment (by schuetze@gmx.de):

The same problem exists for attachments in the wiki (see attachment.py).
There is a HTTP-header 'Content-Disposition', but only for not-binary -
why? Binaries should have this header also.

--
Ticket URL: <http://trac.edgewall.org/ticket/3083#comment:1>
The Trac Project <http://trac.edgewall.org/>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac Tickets" group.
To post to this group, send email to trac-tickets@googlegroups.com
To unsubscribe from this group, send email to trac-tickets-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.se/group/trac-tickets
-~----------~----~----~----~------~----~------~--~---
Re: [The Trac Project] #3083: Bad handling of URLs in IE5/6 when downloading files in raw format [ In reply to ]
#3083: Bad handling of URLs in IE5/6 when downloading files in raw format
----------------------------------------------------+-----------------------
Reporter: Christophe.Muller@research.gemplus.com | Owner: cboos
Type: defect | Status: assigned
Priority: low | Milestone: 0.10.1
Component: browser | Version: 0.9.3
Severity: normal | Resolution:
Keywords: IE, raw, HTTP |
----------------------------------------------------+-----------------------
Changes (by cboos):

* owner: jonas => cboos
* status: new => assigned
* milestone: => 0.10.1

Comment:

Sorry, the patch/issue probably got unnoticed.

Also, #3332 supersedes this one, for 0.11dev.

We could probably put that in 0.10.1, though. Any objections?

--
Ticket URL: <http://trac.edgewall.org/ticket/3083#comment:2>
The Trac Project <http://trac.edgewall.org/>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac Tickets" group.
To post to this group, send email to trac-tickets@googlegroups.com
To unsubscribe from this group, send email to trac-tickets-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.se/group/trac-tickets
-~----------~----~----~----~------~----~------~--~---
Re: [The Trac Project] #3083: Bad handling of URLs in IE5/6 when downloading files in raw format [ In reply to ]
#3083: Bad handling of URLs in IE5/6 when downloading files in raw format
----------------------------------------------------+-----------------------
Reporter: Christophe.Muller@research.gemplus.com | Owner: cboos
Type: defect | Status: assigned
Priority: low | Milestone: 0.10.1
Component: browser | Version: 0.9.3
Severity: normal | Resolution:
Keywords: IE, raw, HTTP |
----------------------------------------------------+-----------------------
Comment (by Christophe.Muller@research.gemplus.com):

Replying to [comment:2 cboos]:
> Sorry, the patch/issue probably got unnoticed.
No problem. I understand that can happen (and I have
my patch installed already.. :-).

Thanks for picking it up.[[BR]]
Cheers,[[BR]]
Christophe
{{{
= The game's isn't over until it's over. --Yogi Berra =
}}}

--
Ticket URL: <http://trac.edgewall.com/ticket/3083#comment:3>
The Trac Project <http://trac.edgewall.org/>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac Tickets" group.
To post to this group, send email to trac-tickets@googlegroups.com
To unsubscribe from this group, send email to trac-tickets-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.se/group/trac-tickets
-~----------~----~----~----~------~----~------~--~---