B
bfmcfarlane
I have an appication that allows users to upload and download files.
This application is only accessed when a user clicks on an "Upload /
Download" link from within our main application. A new window is
launched asking the user which file he /she wants to download. After
the user determines which file to download, the window disappears but
the user is provided with the download file dialog box. I have been
able to track it down to a specific line of code that I believe is
causing this behavior.
Response.Clear();
Response.ContentType = "cis/file-text";
Response.AddHeader("Content-Disposition", "attachment; filename=" +
tempFileName);
Response.BinaryWrite(result);
The third line where I provide teh header details causes the page to
close. If I comment out this line, the page does not close and
obviously the file is not downloaded.
If I access this application directly by opening up IE and typing in
the url, this behavior does not occurr and everything works as
designed. I am struggling with why does this only happen when the
appliaction is accessed via javascript.
Any help is appreciated
This application is only accessed when a user clicks on an "Upload /
Download" link from within our main application. A new window is
launched asking the user which file he /she wants to download. After
the user determines which file to download, the window disappears but
the user is provided with the download file dialog box. I have been
able to track it down to a specific line of code that I believe is
causing this behavior.
Response.Clear();
Response.ContentType = "cis/file-text";
Response.AddHeader("Content-Disposition", "attachment; filename=" +
tempFileName);
Response.BinaryWrite(result);
The third line where I provide teh header details causes the page to
close. If I comment out this line, the page does not close and
obviously the file is not downloaded.
If I access this application directly by opening up IE and typing in
the url, this behavior does not occurr and everything works as
designed. I am struggling with why does this only happen when the
appliaction is accessed via javascript.
Any help is appreciated