SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast navtej's Avatar
    Join Date
    May 2006
    Posts
    74
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Need to download mp3 files plz

    we are tring to dowlload mp3 site the folowwing code only save a file of 16kb every time


    'É necessário passar o nome do arquivo no FORM ou por GET .....
    Dim Arquivo
    'Arquivo = Request("arquivo")
    Arquivo = "cut_aubrey_track_1.mp3"
    Response.Write "<script>alert('" & Arquivo & "')</script>"
    Path = "../files/mp3/cut_aubrey_track_1.mp3"

    '=========================================





    '
    Response.Buffer = True

    Response.AddHeader "Content-Type","application/x-msdownload"
    Response.AddHeader "Content-Disposition","attachment; filename=" & Arquivo


    Response.Flush

    Set objStream = Server.CreateObject("ADODB.Stream")
    objStream.Open
    objStream.Type = 1
    objStream.LoadFromFile Server.MapPath(Path)
    Response.BinaryWrite objStream.Read
    objStream.Close
    Set objStream = Nothing
    Response.Flush

  2. #2
    Original Gangster silver trophy Thing's Avatar
    Join Date
    Oct 2000
    Location
    Philadelphia, PA
    Posts
    4,708
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Whats the problem?

  3. #3
    SitePoint Enthusiast navtej's Avatar
    Join Date
    May 2006
    Posts
    74
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Thing
    Whats the problem?

    It do save the file with correct name but the size is always 16 k as I have changed file also the size remains same, I dont know asp much I am using .net , just need to do this stuff
    , probaly the size is to be increased, cause it is also doing the same with the .jpg format


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •