Saturday, March 24, 2012

Strange error with Response.WriteFile and SSL

I have a site running under SSL. Works well so far but there is one ASPX
page which returns a dynamically created PDF file using Response.WriteFile.

When the browser requests this ASPX page via https (SSL) it displays a
message that secure and non secure items are to be displayed (free
translation from german so it might not be the exact wording in english).
When I say no (means non secure items are not displayed) my PDF still is
displayed - so it seems thats not the one causing the message.

Any ideas whats wrong or even better how to solve it?

Regards,
Martin Knopp
fecher GmbH"Martin Knopp" <martin.knopp@.fecher.at> wrote in news:GGVQb.304173$Tz1.135851
@.news.chello.at:
> I have a site running under SSL. Works well so far but there is one ASPX
> page which returns a dynamically created PDF file using Response.WriteFile.
> When the browser requests this ASPX page via https (SSL) it displays a
> message that secure and non secure items are to be displayed (free
> translation from german so it might not be the exact wording in english).
> When I say no (means non secure items are not displayed) my PDF still is
> displayed - so it seems thats not the one causing the message.
> Any ideas whats wrong or even better how to solve it?

It means that somewhere in the content you are sending back are some http://
referendces instead of https:// references. You need to make all images, and
other external type links https://

--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"

ELKNews - Get your free copy at http://www.atozedsoftware.com
That would have been easy!

I checked for this already and the only thing we return is a PDF document.
Nothing else.

Today I heard from some source that it might be a problem of IE. I will have
to further investigate this probably.

Any other ideas/hints?

--
Martin Knopp
fecher GmbH

"Chad Z. Hower aka Kudzu" <cpub@.hower.org> schrieb im Newsbeitrag
news:Xns947C29C3EBBCcpub@.127.0.0.1...
> "Martin Knopp" <martin.knopp@.fecher.at> wrote in
news:GGVQb.304173$Tz1.135851
> @.news.chello.at:
> > I have a site running under SSL. Works well so far but there is one ASPX
> > page which returns a dynamically created PDF file using
Response.WriteFile.
> > When the browser requests this ASPX page via https (SSL) it displays a
> > message that secure and non secure items are to be displayed (free
> > translation from german so it might not be the exact wording in
english).
> > When I say no (means non secure items are not displayed) my PDF still is
> > displayed - so it seems thats not the one causing the message.
> > Any ideas whats wrong or even better how to solve it?
> It means that somewhere in the content you are sending back are some
http://
> referendces instead of https:// references. You need to make all images,
and
> other external type links https://
>
> --
> Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
> "Programming is an art form that fights back"
>
> ELKNews - Get your free copy at http://www.atozedsoftware.com
"Martin Knopp" <martin.knopp@.fecher.at> wrote in
news:Lm7Rb.314459$Tz1.163161@.news.chello.at:
> I checked for this already and the only thing we return is a PDF
> document. Nothing else.

Does the PDF have any links in it? IE shouldnt see those but..

Do a view source on the HTML and search for http://

--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"

ELKNews - Get your free copy at http://www.atozedsoftware.com
How do you display a PDF?
Do you return the PDF document with proper content type?
Or are you displaying the HTML with embeded PDF?

George.

"Martin Knopp" <martin.knopp@.fecher.at> wrote in message
news:GGVQb.304173$Tz1.135851@.news.chello.at...
> I have a site running under SSL. Works well so far but there is one ASPX
> page which returns a dynamically created PDF file using
Response.WriteFile.
> When the browser requests this ASPX page via https (SSL) it displays a
> message that secure and non secure items are to be displayed (free
> translation from german so it might not be the exact wording in english).
> When I say no (means non secure items are not displayed) my PDF still is
> displayed - so it seems thats not the one causing the message.
> Any ideas whats wrong or even better how to solve it?
> Regards,
> Martin Knopp
> fecher GmbH
I return the PDF with proper contenttype

code-behind in Page_Load event (C#) looks approximately like this:

Response.Clear();
Response.ContentType = "appilcation/pdf";
Response.WriteFile( <local path to PDF document> );
Response.End();

Regards,
Martin Knopp
fecher GmbH
http://www.fecher.at

"George Ter-Saakov" <nospam@.hotmail.com> schrieb im Newsbeitrag
news:OeFFEoC5DHA.2540@.TK2MSFTNGP11.phx.gbl...
> How do you display a PDF?
> Do you return the PDF document with proper content type?
> Or are you displaying the HTML with embeded PDF?
> George.
> "Martin Knopp" <martin.knopp@.fecher.at> wrote in message
> news:GGVQb.304173$Tz1.135851@.news.chello.at...
> > I have a site running under SSL. Works well so far but there is one ASPX
> > page which returns a dynamically created PDF file using
> Response.WriteFile.
> > When the browser requests this ASPX page via https (SSL) it displays a
> > message that secure and non secure items are to be displayed (free
> > translation from german so it might not be the exact wording in
english).
> > When I say no (means non secure items are not displayed) my PDF still is
> > displayed - so it seems thats not the one causing the message.
> > Any ideas whats wrong or even better how to solve it?
> > Regards,
> > Martin Knopp
> > fecher GmbH
go to aspx page you are using for downloads and check to see if in html view
you see any html / aspx elements (if yes remove them)
because when you call Response.Flush they will not be cleared unless you
have default Buffer = true applicable across

a better option for downloads is to use ashx... it httphandler you... they
do offer a performance boost of around 5 - 10%

--
Regards,
HD
Once a Geek... Always a Geek
"Martin Knopp" <martin.knopp@.fecher.at> wrote in message
news:tisRb.330066$Tz1.68379@.news.chello.at...
>I return the PDF with proper contenttype
> code-behind in Page_Load event (C#) looks approximately like this:
> Response.Clear();
> Response.ContentType = "appilcation/pdf";
> Response.WriteFile( <local path to PDF document> );
> Response.End();
> Regards,
> Martin Knopp
> fecher GmbH
> http://www.fecher.at
> "George Ter-Saakov" <nospam@.hotmail.com> schrieb im Newsbeitrag
> news:OeFFEoC5DHA.2540@.TK2MSFTNGP11.phx.gbl...
>> How do you display a PDF?
>> Do you return the PDF document with proper content type?
>> Or are you displaying the HTML with embeded PDF?
>>
>> George.
>>
>> "Martin Knopp" <martin.knopp@.fecher.at> wrote in message
>> news:GGVQb.304173$Tz1.135851@.news.chello.at...
>> > I have a site running under SSL. Works well so far but there is one
>> > ASPX
>> > page which returns a dynamically created PDF file using
>> Response.WriteFile.
>>> > When the browser requests this ASPX page via https (SSL) it displays a
>> > message that secure and non secure items are to be displayed (free
>> > translation from german so it might not be the exact wording in
> english).
>> > When I say no (means non secure items are not displayed) my PDF still
>> > is
>> > displayed - so it seems thats not the one causing the message.
>>> > Any ideas whats wrong or even better how to solve it?
>>> > Regards,
>> > Martin Knopp
>> > fecher GmbH
>>>>
>>

0 comments:

Post a Comment