Music file Download?

Posted by Chandru_ra under C# on 3/28/2011 | Points: 10 | Views : 1963 | Status : [Member] | Replies : 0
Dear all

hi

now am file downloading concept

protected void LinkButton1_Click(object sender, EventArgs e)
{
string FilePath = Server.MapPath(Request.QueryString["MusicUpload"].ToString());
System.IO.FileInfo TargetFile = new System.IO.FileInfo(FilePath);
if (TargetFile.Exists)
{
Response.Clear();
Response.AddHeader("Content-Disposition", "attachment; filename=" + TargetFile.Name);
Response.AddHeader("Content-Length", TargetFile.Length.ToString());
Response.ContentType = "application/octet-stream";
Response.WriteFile(TargetFile.FullName);
}

but this coding client side but not support server side...

chandru


Responses

(No response found.)

Login to post response