Binary Stream opens in same frame instead of new window

A

axiarich

We have some doc mgt "lite" on our site. I basically have a window with
a button that opens the relevant document (Excel, PDF, etc.). The
button calls some javascript which basically performs a window open:

window.open('document.asp?item=' + intDoc,'_self', '');

I use '_self' so that the document.asp itself does not open a new
browser. the document.asp file basically retrieves the path and
displays the document via the ADODB Stream object:

select case vType
Case "DOC", "RTF"
Response.ContentType = "application/x-msword"
Case "PDF"
Response.ContentType = "application/pdf"
Case "XLS", "CSV"
Response.ContentType = "application/x-msexcel"
end select

set objStream = server.CreateObject("ADODB.Stream")
objStream.Open
objStream.Type = adTypeBinary
objStream.LoadFromFile strFile

Response.BinaryWrite objStream.Read

For me and most every user, when we click the button on the original
page, we first get the "File Download" pop-up and then - assuming you
click Open - the document opens in a new window: Adobe for PDFs, Excel
for excel docs, etc. For one user, documents are not opening in a new
window, but rather in the original frame where the document button is
located.

Does anyone know if this is a browser setting? something I can control
in my code? This particular user is using IE 6 and Excel 2003 and Adobe
Reader 6.0.
Thanks!
 
A

Anthony Jones

We have some doc mgt "lite" on our site. I basically have a window with
a button that opens the relevant document (Excel, PDF, etc.). The
button calls some javascript which basically performs a window open:

window.open('document.asp?item=' + intDoc,'_self', '');

I use '_self' so that the document.asp itself does not open a new
browser. the document.asp file basically retrieves the path and
displays the document via the ADODB Stream object:

select case vType
Case "DOC", "RTF"
Response.ContentType = "application/x-msword"
Case "PDF"
Response.ContentType = "application/pdf"
Case "XLS", "CSV"
Response.ContentType = "application/x-msexcel"
end select

set objStream = server.CreateObject("ADODB.Stream")
objStream.Open
objStream.Type = adTypeBinary
objStream.LoadFromFile strFile

Response.BinaryWrite objStream.Read

For me and most every user, when we click the button on the original
page, we first get the "File Download" pop-up and then - assuming you
click Open - the document opens in a new window: Adobe for PDFs, Excel
for excel docs, etc. For one user, documents are not opening in a new
window, but rather in the original frame where the document button is
located.

Does anyone know if this is a browser setting? something I can control
in my code? This particular user is using IE 6 and Excel 2003 and Adobe
Reader 6.0.
Thanks!

On your machine open Windows Explorer goto tools | folder options and the
File Types tab.
Scroll to and select xls then click the advanced button.
What is the state of the 'Browse in same window' check box? What about the
machine which has different behaviour?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,808
Messages
2,569,684
Members
45,443
Latest member
sol

Latest Threads

Top