J
Jeremy Chapman
I have build a web page that lists files in a database. When the user
clicks on the file the page streams the file contents to the browser with
code like:
Response.AppendHeader("Content-Disposition","attachment;filename=" +
strFileName);
Response.AppendHeader("Content-Length",lLength.ToString());
Response.ContentType = strContentType;
Response.BinaryWrite(binData);
My problem is that if the file is html or xml, it appears in the browser
window. If the file is jpg, text, etc it appears in a seperate application
window. The desired behaviour is to always show the document in a seperate
window, but I can't write specific code to handle each file type
individually. Is it possible to force the file to download a view in a
seperate window?
clicks on the file the page streams the file contents to the browser with
code like:
Response.AppendHeader("Content-Disposition","attachment;filename=" +
strFileName);
Response.AppendHeader("Content-Length",lLength.ToString());
Response.ContentType = strContentType;
Response.BinaryWrite(binData);
My problem is that if the file is html or xml, it appears in the browser
window. If the file is jpg, text, etc it appears in a seperate application
window. The desired behaviour is to always show the document in a seperate
window, but I can't write specific code to handle each file type
individually. Is it possible to force the file to download a view in a
seperate window?