M
Marius Horak
Web application has the following code for downloading a file from a server
this.Context.Response.Clear();
this.Context.Response.BufferOutput = false;
this.Context.Response.ContentType = "application/octet-stream";
this.Context.Response.AddHeader("Content-Disposition","attachment;
filename=" + FileName);
// this.Context.Response.AddHeader("Content-Length",fileSize.ToString());
this.Context.Response.Flush();
this.Context.Response.WriteFile(FullFileName);
// this.Context.Response.Flush();
// this.Context.Response.End();
It runs after a button on a page is clicked.
The code apparently never worked. Code is being executed without errors but
nothing happens.
I checked some examples and they were more or less as the above code.
What could be wrong?
What should I expect with working code - the download dialog box?
Thanks
MH
this.Context.Response.Clear();
this.Context.Response.BufferOutput = false;
this.Context.Response.ContentType = "application/octet-stream";
this.Context.Response.AddHeader("Content-Disposition","attachment;
filename=" + FileName);
// this.Context.Response.AddHeader("Content-Length",fileSize.ToString());
this.Context.Response.Flush();
this.Context.Response.WriteFile(FullFileName);
// this.Context.Response.Flush();
// this.Context.Response.End();
It runs after a button on a page is clicked.
The code apparently never worked. Code is being executed without errors but
nothing happens.
I checked some examples and they were more or less as the above code.
What could be wrong?
What should I expect with working code - the download dialog box?
Thanks
MH