Posted on: 5/6/2011 5:00:34 AM | Views : 209

Hi, every one i am trying to download a file named "result.wmv". This file is located at the route directory of my web site folder. this is the code i am trying, this code is inside a button click event.
protected void Lbldown_Click(object sender, ImageClickEventArgs e)
{

try
{
String filename = Server.MapPath("~/result.wmv");
//String filename = "result.wmv";

// set the http content type to "APPLICATION/OCTET-STREAM
Response.ContentType = "APPLICATION/OCTET-STREAM";

// initialize the http content-disposition header to
// indicate a file attachment with the default filename
// "myFile.txt"
String disHeader = "Attachment; Filename=\"" + filename +
"\"";
Response.AppendHeader("Content-Disposition", disH ...

Go to the complete details ...