VBAHole22 Posted January 20, 2006 Posted January 20, 2006 (edited) I am trying to provide a button for a user to click and then they download a file from my web page. The problem I am having with this code is that it sends the file to user, but at the end of the file is tacked on the html of the page itself. How can I get rid of that part at the end? http://www.ondotnet.com/pub/a/dotnet/2002/04/01/asp.html The important part of the code is as follows: string filename = Path.GetFileName(filepath); Response.Clear(); Response.ContentType = "application/octet-stream"; Response.AddHeader("Content-Disposition",@"attachment; filename=" + filename + ""); Response.Flush(); Response.WriteFile(filepath); Edited January 20, 2006 by PlausiblyDamp Quote Wanna-Be C# Superstar
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.