tomhoran
asked on
BinaryWrite and SSL
I'm creating a PDF file on the fly and feeding it to the browser using BinaryWrite. The website is secure (runnng SSL) and when the page displays it pops up the message:
"This page both secure and non-secure items. Do you want to display the non-secure items?"
How can i make sure the binary feed u=is encrypted?
"This page both secure and non-secure items. Do you want to display the non-secure items?"
How can i make sure the binary feed u=is encrypted?
Is the binary write (the source of the PDF) coming from the SSL folder? ie a SECURE folder?
ASKER
i would have to say yes. the ssl is www.repayme.com and then the folder for the binarywrite comes from
www.repayme.com/admin/reports/binarywritepgm.asp (not the real name)
www.repayme.com/admin/reports/binarywritepgm.asp (not the real name)
so they are both https:// ? including the source that you read to make the pdf? There was a post similar to this recently- I did a search on the archives but couldn't find it..
Have you looked at any tech articles on thawte.com or openssl.org?
Have you looked at any tech articles on thawte.com or openssl.org?
ASKER
no. I'm using crystal to create the .pdf file stream, here is my code:
Set oApp = Server.CreateObject("Cryst alRuntime. Applicatio n.9")
Path = Request.ServerVariables("P ATH_TRANSL ATED")
While (Right(Path, 1) <> "\" And Len(Path) <> 0)
iLen = Len(Path) - 1
Path = Left(Path, iLen)
Wend
Set oRpt = oApp.OpenReport(Path & ReportName, 1)
Set oPageEngine = oRpt.PageEngine
Pagehelper = Array()
Set oPageGenerator = oPageEngine.CreatePageGene rator(Page Helper)
recordsel = "{reimburse_check.delivery _method} = 'L' " & _
"and {reimburse_check.cust_no} = '" & custno & "' " & _
"and {reimburse_check.process_n o} = " & whichproc & _
whichcmp
oRpt.RecordSelectionFormul a = CStr(recordsel)
oRpt.ParameterFields.GetIt emByName(" plain_pape r").AddCur rentValue( CStr(plain paper))
oRpt.ParameterFields.GetIt emByName(" test_check ").AddCurr entValue(C Str(testch eck))
'///////////////////////// ////////// ////////// ////////// ////
'// Use the report object and the export options object //
'// to set up the export type and destination. //
'///////////////////////// ////////// ////////// ////////// ////
With oRpt
.MorePrintEngineErrorMessa ges = False
.EnableParameterPrompting = False
With .ExportOptions
.DestinationType = DestinationType
.FormatType = FormatType
End With
End With
With Response
.Expires = 0
.Buffer = True
.Clear
.ContentType = "application/pdf"
.BinaryWrite oPageGenerator.Export(8209 )
End With
Set oApp = Server.CreateObject("Cryst
Path = Request.ServerVariables("P
While (Right(Path, 1) <> "\" And Len(Path) <> 0)
iLen = Len(Path) - 1
Path = Left(Path, iLen)
Wend
Set oRpt = oApp.OpenReport(Path & ReportName, 1)
Set oPageEngine = oRpt.PageEngine
Pagehelper = Array()
Set oPageGenerator = oPageEngine.CreatePageGene
recordsel = "{reimburse_check.delivery
"and {reimburse_check.cust_no} = '" & custno & "' " & _
"and {reimburse_check.process_n
whichcmp
oRpt.RecordSelectionFormul
oRpt.ParameterFields.GetIt
oRpt.ParameterFields.GetIt
'/////////////////////////
'// Use the report object and the export options object //
'// to set up the export type and destination. //
'/////////////////////////
With oRpt
.MorePrintEngineErrorMessa
.EnableParameterPrompting = False
With .ExportOptions
.DestinationType = DestinationType
.FormatType = FormatType
End With
End With
With Response
.Expires = 0
.Buffer = True
.Clear
.ContentType = "application/pdf"
.BinaryWrite oPageGenerator.Export(8209
End With
ASKER
no. I'm using crystal to create the .pdf file stream, here is my code:
Set oApp = Server.CreateObject("Cryst alRuntime. Applicatio n.9")
Path = Request.ServerVariables("P ATH_TRANSL ATED")
While (Right(Path, 1) <> "\" And Len(Path) <> 0)
iLen = Len(Path) - 1
Path = Left(Path, iLen)
Wend
Set oRpt = oApp.OpenReport(Path & ReportName, 1)
Set oPageEngine = oRpt.PageEngine
Pagehelper = Array()
Set oPageGenerator = oPageEngine.CreatePageGene rator(Page Helper)
recordsel = "{reimburse_check.delivery _method} = 'L' " & _
"and {reimburse_check.cust_no} = '" & custno & "' " & _
"and {reimburse_check.process_n o} = " & whichproc & _
whichcmp
oRpt.RecordSelectionFormul a = CStr(recordsel)
oRpt.ParameterFields.GetIt emByName(" plain_pape r").AddCur rentValue( CStr(plain paper))
oRpt.ParameterFields.GetIt emByName(" test_check ").AddCurr entValue(C Str(testch eck))
'///////////////////////// ////////// ////////// ////////// ////
'// Use the report object and the export options object //
'// to set up the export type and destination. //
'///////////////////////// ////////// ////////// ////////// ////
With oRpt
.MorePrintEngineErrorMessa ges = False
.EnableParameterPrompting = False
With .ExportOptions
.DestinationType = DestinationType
.FormatType = FormatType
End With
End With
With Response
.Expires = 0
.Buffer = True
.Clear
.ContentType = "application/pdf"
.BinaryWrite oPageGenerator.Export(8209 )
End With
Set oApp = Server.CreateObject("Cryst
Path = Request.ServerVariables("P
While (Right(Path, 1) <> "\" And Len(Path) <> 0)
iLen = Len(Path) - 1
Path = Left(Path, iLen)
Wend
Set oRpt = oApp.OpenReport(Path & ReportName, 1)
Set oPageEngine = oRpt.PageEngine
Pagehelper = Array()
Set oPageGenerator = oPageEngine.CreatePageGene
recordsel = "{reimburse_check.delivery
"and {reimburse_check.cust_no} = '" & custno & "' " & _
"and {reimburse_check.process_n
whichcmp
oRpt.RecordSelectionFormul
oRpt.ParameterFields.GetIt
oRpt.ParameterFields.GetIt
'/////////////////////////
'// Use the report object and the export options object //
'// to set up the export type and destination. //
'/////////////////////////
With oRpt
.MorePrintEngineErrorMessa
.EnableParameterPrompting = False
With .ExportOptions
.DestinationType = DestinationType
.FormatType = FormatType
End With
End With
With Response
.Expires = 0
.Buffer = True
.Clear
.ContentType = "application/pdf"
.BinaryWrite oPageGenerator.Export(8209
End With
I think it's because the crystal dll is in the system folder and not the ssl folder so when it is called you get the message. I wish I could find the post from the other week... Are you able to copy and register the Crystal dll in the SSL folder?
ASKER
not sure that's the problem as their activex view doesn't have this problem.
i talked with them and they mentioned that it had to do with the header or something not being created before the binary string was hitting the browser.
i talked with them and they mentioned that it had to do with the header or something not being created before the binary string was hitting the browser.
can you use a server.execute to make the file on the fly and then read it?
ASKER
what would that do for me? what does "server.execute" do?
don't quote me (see the msdn site on "25 ways to improve web site performance"..
http://msdn.microsoft.com/workshop/server/asp/asptips.asp) but I think it's an IIS5 way of executing a server file ie an asp file within the body of an asp page- so you might be able to make the pdf that way
http://msdn.microsoft.com/workshop/server/asp/asptips.asp) but I think it's an IIS5 way of executing a server file ie an asp file within the body of an asp page- so you might be able to make the pdf that way
The PDF file doesn't contain any http: references, like images et al, does it?
ASKER
no images at all. if i save it to a file then display it via a href it displays with no problems.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I got this thing figured out...I know where the problem is, just don't know why.
Here are the steps:
1: I have a window with a hyper-link. When it's clicked it opens a new window (wk1.asp), which is secure as the lock is in the status bar.
2: This new window (wk1.asp) allows the user to select what they want to include in the .pdf file/report. They fill in some fields then click a button which then does a response.redirect to wk2.asp (I've also confirmed that it's an issue when using a form/submit)
3: wk2.asp has the code to create the response.BinaryWrite and this is where/when I get the "This page both secure and non-secure items. Do you want to display the non-secure items?"
The interesting thing is, if I do a hyper link to wk2.asp instead of a response.redirect or submit I don’t get the error???
Here are the steps:
1: I have a window with a hyper-link. When it's clicked it opens a new window (wk1.asp), which is secure as the lock is in the status bar.
2: This new window (wk1.asp) allows the user to select what they want to include in the .pdf file/report. They fill in some fields then click a button which then does a response.redirect to wk2.asp (I've also confirmed that it's an issue when using a form/submit)
3: wk2.asp has the code to create the response.BinaryWrite and this is where/when I get the "This page both secure and non-secure items. Do you want to display the non-secure items?"
The interesting thing is, if I do a hyper link to wk2.asp instead of a response.redirect or submit I don’t get the error???
when you submit the form or use a redirect, are you using the full https://www.dom.com/w2k.asp ?
ASKER
no. I don't do that with any of the other 200+ pages in the system. the page is is already within the secure site, so it shouldn't be needed
ASKER
just for the heck of it i added the https:// on the submit and same error occured
I know this'll sound odd, have you tried recreating the page from scratch on overwriting the old file? Strange one!
ASKER
Thanks for your help