I can't say I totally understand how registering a script would help in this
situation since I have server side database updates to do, to record history
of downloads, etc.
Maybe if you could expand on your example a little more so I would know
where the database updates would go and how to execute the script on the
server side that would help. If registering the script is an IE only
solution then we can't use it since we are trying to support Netscape 6.0
also.
I'd also like to know if this is a known bug in ASP.NET or a bug in IE.
Netscape doesn't have this problem.
Here is all the code if that helps.
private void Page_Load(objec t sender, System.EventArg s e)
{
UploadedFiles UPFiles = new UploadedFiles() ;
string filepath = Page.Request.Pa rams["file"];
if (!(filepath == null))
{
HPSession HPSess = new HPSession();
string UserID = HPSess.getUserI DbySessionID(Se ssion.SessionID );
UPFiles.Uploade dFilesHistoryAd dUpdate("",
Page.Request.Pa rams["UploadedFileID "], UserID);
FileInfo fi = new FileInfo(filepa th);
string filename = fi.Name;
Response.Clear( );
Response.ClearH eaders();
Response.ClearC ontent();
Response.AddHea der("Content-Disposition", "attachment ; filename=" +
filename);
Response.Append Header("Content-Length", fi.Length.ToStr ing());
Response.Conten tType = "applicatio n/octet-stream";
Response.WriteF ile(filepath);
Response.End();
Response.Flush( );
}
}
"karl" <ka******@hotma il.com> wrote in message
news:Ow******** ******@TK2MSFTN GP12.phx.gbl...
by using a register script similar to this in your code then you can
actually use a script from your server.
this.RegisterSt artupScript("po pupDialog", "<script language='javas cript'>
showAlertDialog (); </script>");
simply place it after the code that you need to fire first.
Karl
"Tony K" <to**@tksoftwar einc.com> wrote in message
news:uS******** ******@TK2MSFTN GP10.phx.gbl... I have the most peculiar problem with an ASP.NET page which we use for
downloading a file.
When the user clicks on a link, the link points to an ASPX page which
downloads the file selected.
The code works fine except after the user saves the file, the links on
the left side of the
frameset do not work. IE locks up.
If the user clicks the refresh button after they download, then
everything works properly again.
Or if the user selects 'OPEN' instead of 'SAVE' on the download dialog
box then the problem doesn't occur.
If I comment out the following line then the problem doesn't occur,
however the attachment name doesn't
appear in the download dialog box either.
Response.AddHea der("Content-Disposition", "attachment ; filename=" +
filename);
There is something about the attachment name that is causing this
problem.
The reason we do this in an aspx page instead of in a script is because
we want to do a server side
database update to record the user who is about to download the file
(that code is not shown below).
private void Page_Load(objec t sender, System.EventArg s e)
{
FileInfo fi = new FileInfo("C:\\t est.aspx");
string filename = fi.Name;
Response.Clear( );
Response.ClearH eaders();
Response.ClearC ontent();
// "\"" + filename + "\"\""
Response.AddHea der("Content-Disposition", "attachment ; filename=" +
filename);
Response.Append Header("Content-Length", fi.Length.ToStr ing());
Response.Conten tType = "applicatio n/octet-stream";
Response.WriteF ile(filepath);
Response.End();
Response.Flush( );
}