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. c# code for downloading a video file

c# code for downloading a video file

Scheduled Pinned Locked Moved ASP.NET
csharpasp-nethelp
7 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.
  • S Offline
    S Offline
    sarodam
    wrote on last edited by
    #1

    i have a web application which have video files. when i am clicking it its get opening in an IE but i want it 2 be downloaded..hw to code it i am working in asp.net 2.0 with C#.plz help me..

    B A 2 Replies Last reply
    0
    • S sarodam

      i have a web application which have video files. when i am clicking it its get opening in an IE but i want it 2 be downloaded..hw to code it i am working in asp.net 2.0 with C#.plz help me..

      B Offline
      B Offline
      badgrs
      wrote on last edited by
      #2

      You would have to embed the movie in the page, either using a windows media player/quicktime object or a flash movie player (ala YouTube)

      S 1 Reply Last reply
      0
      • S sarodam

        i have a web application which have video files. when i am clicking it its get opening in an IE but i want it 2 be downloaded..hw to code it i am working in asp.net 2.0 with C#.plz help me..

        A Offline
        A Offline
        asithangae
        wrote on last edited by
        #3

        set the mime type for video. Response.Content-type = "application/avi"; Response.AddHeader("content-disposition","attachment;filename=sample.avi"); Here i used the video file extension as avi, if you want to change you can do as you wish.the sample.avi is located in application folder in my example, change it to appropriate application relative path. i think this code may be usefull to you. cheers asithangae

        S 1 Reply Last reply
        0
        • B badgrs

          You would have to embed the movie in the page, either using a windows media player/quicktime object or a flash movie player (ala YouTube)

          S Offline
          S Offline
          sarodam
          wrote on last edited by
          #4

          i have already embedded the video file.bt when i am clicking its just opening in the IE. i want to give the link for downloading..hw to code that

          1 Reply Last reply
          0
          • A asithangae

            set the mime type for video. Response.Content-type = "application/avi"; Response.AddHeader("content-disposition","attachment;filename=sample.avi"); Here i used the video file extension as avi, if you want to change you can do as you wish.the sample.avi is located in application folder in my example, change it to appropriate application relative path. i think this code may be usefull to you. cheers asithangae

            S Offline
            S Offline
            sarodam
            wrote on last edited by
            #5

            a user have logged into the site. He when clicks the download button a dialog box should open asking where it should be saved.when he gives a path it should start downloading...hw to code it..

            V 1 Reply Last reply
            0
            • S sarodam

              a user have logged into the site. He when clicks the download button a dialog box should open asking where it should be saved.when he gives a path it should start downloading...hw to code it..

              V Offline
              V Offline
              varshavmane
              wrote on last edited by
              #6

              Where u have to save this file on server or on client machine.U r using ASP.NET 2005 or ASP.NET 2003???

              S 1 Reply Last reply
              0
              • V varshavmane

                Where u have to save this file on server or on client machine.U r using ASP.NET 2005 or ASP.NET 2003???

                S Offline
                S Offline
                sarodam
                wrote on last edited by
                #7

                i have 2 save it in client machine. i am using asp.net 2005

                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