954,595 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Download .mp3 File in ASP.Net Using VB.Net Code

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()
abdul_rouf26
Newbie Poster
2 posts since Sep 2008
Reputation Points: 10
Solved Threads: 0
 

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()
__avd
Posting Genius (adatapost)
Moderator
8,648 posts since Oct 2008
Reputation Points: 2,136
Solved Threads: 1,241
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: