Reported at
TWiki:Support.SID-01010
by
TWiki:Main.MartinRothbaum
. See test case at the support topic.
--
TWiki:Main/PeterThoeny
- 2010-11-04
I'm happy to code a patch, but am struggling to see (after a quick look at the code) where the modification of the filename might be happening. Is there anywhere in TWiki where this sort of thing is done deliberately?
--
TWiki:Main.MartinRothbaum
- 2010-11-05
Possible place:
twiki/lib/TWiki/Response.pm
, there is a
lc
in
sub header
.
--
TWiki:Main.PeterThoeny
- 2010-11-05
Thanks Peter - this does seem to be the code that is doing it. I can't see how the underscores are being replaced with hyphens though.
Regardless, it seems that if change viewfile in View.pm (line 497) to set the -attachment property(?) rather than add Content-Disposition as an "other" header, the filename comes out ok. A side effect is that the disposition is set as "attachment" rather than "inline". Do you think this would be a problem? (
patch to View.pm) attached.
--
TWiki:Main.MartinRothbaum
- 2010-11-19
Thanks for the patch Martin! Not sure if it causes a problem, it needs to be tested. For example, .txt and .html should load in browser window (IE, FF, Safari), not popup a save dialog box. And images referenced in img tags should show inline in html & twiki pages.
--
TWiki:Main.PeterThoeny
- 2010-11-19
Hi Peter. Yes there does seem to be some incorrect behaviour at least with FF - images get displayed ok, but HTML gets the save dialog box.
Looking through the TWiki code there doesn't seem to be any other use of the -attachment parameter to sub header. Would it be reasonable to just change the disposition to inline in sub header, or should I add another parameter -inline. It does seem to make sense to consolidate all the header creation in sub header (rather than in View.pm).
--
TWiki:Main.MartinRothbaum
- 2010-11-30
Multiple issues here. CGI::Util::rearrange is what is changing case and replacing underscores with hyphens when parameter passed with this object method: $session->{response}->header(-type => $type, qq(Content-Disposition="$dispo") ); solution in View.pm sub header was to reset parameters other then named pairs to what they were prior to unwanted lc and s/-/_/ changes by rearrange. This caused View.pm sub redirect to get undef return from sub header because redirect uses same rearrange method (and had same issue as above) Solution was to create private method sub _header without fix for use by redirect.
--
TWiki:Main.GeorgeTrubisky
- 2011-04-02
George, good progress here! Once tested, please port back to 5.0 branch as well.
--
TWiki:Main.PeterThoeny
- 2011-04-05