views:

33

answers:

2

Hi, I have a page that dynamically links to a document that opens in a new page (the document is stored in a database as binary data and I loaded using the following code:

Response.ClearContent()

Response.ContentType = myReader("MIMEType").ToString()

Response.AddHeader("Content-Disposition", "inline; filename=" & myReader("Filename"))

Response.BinaryWrite(myReader("DocBD"))

Response.End()

This works ok. However some documents have restricted access and before loading the document the user is redirected to a login page. After entering username and passowrd the document is loaded. If it is a pdf file for example, it loads in the same login page, but when it is a word or excel document it opens outside the browser window and the login page remains in the background. Is ther a way to force a word or excel document to open inside the browser window? Many thanks.

A: 

My guess would be no, due to the way Word works. Every document (and I think it consider the login as such) is opened in a different window.

Wildhorn
A: 

You will need a plugin that shows Word documents for the webbrowser.

The PDF reader you are using (Acrobat?) has a browser plugin, its not the browser that renders the content.

rdkleine
Thanks for your answers. How could you force the login page to close?
netNewbi3
You can't. Once the document is downloaded it out of your reach
rdkleine
So do I have to leave the login page running (username and password still in the textboxes)? Nothing can be done? Thanks!
netNewbi3
You could redirect after login. (response.redirect) and on the upload.aspx (for example) page you write your response.write code.
rdkleine
Hi, if I add a response.redirect line after Response.BinaryWrite, the page gets redirectered but the document doesn't load.
netNewbi3