sounds like you're at the level of needing ethereal, or some similar 
tool, running on the client side. it has helped me a lot of times when 
browsers were doing something unintuitive. it won't really give you a 
lot of help on the https connection, but since the problem occurs with 
http, you should be able to see exactly what headers/info the browser is 
getting, and what it is actually trying to retrieve. you might also run 
the network trace first while downloading the file with firefox to 
provide a "benchmark" for what a clean transaction looks like.

ps--i'd still be careful about the whitespace in this component. in our 
shop, we use %'s at the top and bottom as well as to provide space 
between tags like </%args> and <%init> so that the mason compiler 
doesn't produce extra whitespace. take a look at the obj file before and 
after this change and it should be insightful.

J Cook wrote:
> Thanks for the replies, and sorry for not showing the code. I had the 
> following code in a dhandler that was causing trouble with IE:
> 
> <%args>
> $arg1 => ''
> </%args>
> 
> <%init>
> my ($order) = ($r->filename =~ /.*?\/letters\/(.*?)\.pdf/gi);
> my $output = generate_pdf($order, $arg1);
> #$r->content_type('application/pdf');
> $m->clear_buffer;
> $m->print($output);
> $m->abort;
> </%init>
> 
> <%flags>
> inherit => undef
> </%flags>
> 
> I changed the code to:
> 
> <%args>
> $arg1 => ''
> </%args>
> 
> <%init>
> $m->clear_buffer;
> my ($order) = ($r->filename =~ /.*?\/letters\/(.*?)\.pdf/gi);
> my $output = generate_pdf($order, $arg1);
> $r->content_type('application/pdf');
> $r->headers_out->{'Content-Disposition'} =
>         "attachment;  filename=$order.pdf";
> $r->headers_out->set('Content-Length' => length($output));
> $r->send_http_header;
> $m->print($output);
> $m->abort(OK);
> </%init>
> 
> <%flags>
> inherit => undef
> </%flags>
> 
> And it still wouldn't work for IE. The error I get is:
> 1. File Download Security Warning - it asks if I want to download the file.
> 2. I click on save or open and I get the "file download" popup but I get 
> another popup immediately after saying:
>  "IE cannot download filename.pdf from www.domain.com. IE was not able 
> to open this Internet site. The requested site is either unavailable or 
> cannot be found. Please try again later."
>  I click on "OK" and it aborts the download.
> 
> Now the above error always happened with a http:// request, but I found 
> that it works fine if the request is https://. Go figure. So I guess 
> I'll accept that and always link to it using ssl. Wonder why that is though.
> 
> Justin
> 
> 
> 
> Andreas Marienborg wrote:
> 
>>At work we serve custom PDF files with the following component:
>>
>>$m->clear_buffer;
>>$r->content_type("application/pdf");
>>$r->headers_out->set('Content-Length' => length($data));
>>$r->send_http_header;
>>$m->print($data);
>>$m->abort(OK)
>>
>>where $data is the PDF document as a scalar.
>>
>>and for future questions, a code snippet might help alot in aiding you 
>>better :)
>>
>>
>>andreas
>>
>>
>>On 27. jul. 2006, at 23.10, J Cook wrote:
>>
>>
>>>I am generating a pdf on the fly and serving it up with mason, I set the
>>>headers out -> content type application/pdf and this works fine in
>>>Mozilla and Firefox but Internet Explorer throws an error and won't
>>>proceed with the download. Anyone have any clue as to why this is?
>>>
>>>Justin
>>>
>>>------------------------------------------------------------------------- 
>>>
>>>Take Surveys. Earn Cash. Influence the Future of IT
>>>Join SourceForge.net's Techsay panel and you'll get the chance to 
>>>share your
>>>opinions on IT & business topics through brief surveys -- and earn cash
>>>http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV 
>>>
>>>_______________________________________________
>>>Mason-users mailing list
>>>Mason-users@lists.sourceforge.net
>>>https://lists.sourceforge.net/lists/listinfo/mason-users
>>
>>
> 
> 
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys -- and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Mason-users mailing list
> Mason-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mason-users

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Mason-users mailing list
Mason-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mason-users

Reply via email to