Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Download Mp3

Download Mp3

Scheduled Pinned Locked Moved ASP.NET
question
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kavinnagarajan
    wrote on last edited by
    #1

    I have developed a website for listening mp3 songs. But i should give option to download MP3 songs when visitors click Download button. How can i do it?

    C S 2 Replies Last reply
    0
    • K kavinnagarajan

      I have developed a website for listening mp3 songs. But i should give option to download MP3 songs when visitors click Download button. How can i do it?

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      Just write the code to set the content type and then send the bytes of the file. Or just have a link that users can right click on to download.

      Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

      1 Reply Last reply
      0
      • K kavinnagarajan

        I have developed a website for listening mp3 songs. But i should give option to download MP3 songs when visitors click Download button. How can i do it?

        S Offline
        S Offline
        sajjy
        wrote on last edited by
        #3

        it`s very easy friend ;) the work you must do is just to give the visitor the path of that file ! for example if you have button that visitor clicks that to download file you do this on button_click :

        protected void btn1_Click(object sender, EventArgs e)
        {
        Response.Redirect("~musicsfolder//music.mp3");
        }

        M 1 Reply Last reply
        0
        • S sajjy

          it`s very easy friend ;) the work you must do is just to give the visitor the path of that file ! for example if you have button that visitor clicks that to download file you do this on button_click :

          protected void btn1_Click(object sender, EventArgs e)
          {
          Response.Redirect("~musicsfolder//music.mp3");
          }

          M Offline
          M Offline
          morsanu
          wrote on last edited by
          #4

          It's better if you do this without calling the click server event. If you create the link dynamically you can set the "href" attribute on page load and that's it.

          Who are you and why should I care?

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups