Based on this : ASP.Net Download file to client browser
This should also work : ( contenu
is a string )
Response.Clear();
Response.ClearHeaders();
Response.ClearContent();
Response.AddHeader("Content-Disposition", "attachment; filename=\"" + txtFileName.Value.ToString() + "\"");
Response.AddHeader("Content-Length", contenu.Length.ToString());
Response.ContentType = "text/plain";
Response.Flush();
Response.Write(contenu);
Response.End();
However, after Response.End()
the browser seems to react because i see it working, but then nothing happens...
Same for Chrome and Explorer.
What should i do ?