Hello Experts,

I am Developing A Web Project. I have done the given below Code in which I want to download a (.mp3) File from a folder located on my web server.

The given below Code working fine but the problem is that when I run this code on my developing Machine then Downloaded file shows me the 0KB Size.
I have searched much more but in vain.

Thanks in Advance.

Response.Clear()
      Response.ClearContent()
      Response.ContentType = "audio/x-mp3"
      Response.AppendHeader("Content-Disposition", "attachment; filename= Rabba Ishq Na Hoe.mp3")
      Response.TransmitFile("~/Audio/Andaaz/Rabba Ishq Na Hove.mp3")
      Response.Clear()
      Response.Flush()
      Response.End()

Don't invoke Clear method.

Response.Clear()
      Response.ClearContent()
      Response.ContentType = "audio/x-mp3"
      Response.AppendHeader("Content-Disposition", "attachment; filename= Rabba Ishq Na Hoe.mp3")
      Response.TransmitFile("~/Audio/Andaaz/Rabba Ishq Na Hove.mp3")
      Response.Flush()
      Response.End()
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.