It's a bit complicated this one... Lets say I have a listing of PDF files displayed in the user's browser. Each filename is a link pointing not to the file, but to an ASP page, say
<--a href="viewfile.asp?file=somefile.pdf">somefile.pdf</a>
I want viewfile.asp to fetch the file (I've done that bit OK) but I then want the file to be loaded by the browser as if the user had opened the PDF file directly. And I want it to open in a new tab or browser window.
here's (simplified) viewfile.asp:
<%
var FileID = Request.querystring ("file") ;
var ResponseBody = MyGETRequest (SomeURL + FileID) ;
if (MyHTTPResult == 200)
{
if (ExtractFileExt (FileID).toLowerCase = "pdf")
{
?????? // return file contents in new browser tab
}
....
%>