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. Downloading File through ASP.

Downloading File through ASP.

Scheduled Pinned Locked Moved Web Development
htmldatabasecom
3 Posts 2 Posters 3 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.
  • D Offline
    D Offline
    Daniel Fiske
    wrote on last edited by
    #1

    If I have a database that has a whole lot of files in it that are incoded in BASE64. Is there some way I can return them straight to HTML so the browser knows to it is downloading a file....e.g. I want to return the BLOB so that I am really returning an HTML page to the person will see www.xyz.com/download.asp and download.asp contains something like Content-Type: application/octet-stream; name="test.exe" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="test.exe" qANQR1DBwA4DXCexCm8KkTsQAv9wDCPX+7o05gnUq0hH5nEPofQ5a8bpnx82OqvmgKCd65fBIbz9 8GjkmslBrB9N+LU7G0RMbhIZFYHcoqOMW1Jje64UR/6TLQ/61Fw+v/j0bsPXU8/ACdb0tX9kNjR8 C/0C/0k7nBcylnZmMHrYXeuGfjAnLjyXMu08+wCCCf0IYn6COEZObwCXlESgOXfIITMq44QJno91 w4enDZ5t0X9KewUrcVh8hUq4WKsXGPRI0DV5YlJEuNAImlf+DvL4DrtI9cHCTgPZ0XOtEPSlchAM AKIJh+R2vswfQheAla7fkLp1hqShCra1DkXTdU41EHfwf9EVmOs2d9ovLuFWnH8ukqh8BYNjXuxK Rfo13mMXqRQBW5b0pKcVPONOcokD2mDaKiuYIbmwm6A+I9LUfAoxg9tj6IrF1LxL53Ysq3FMxqh0 OJKg5iYpBqnhCVgUon6p/Fn41onF9HVhbxZsdRTpIum9YjctoMGNb3DTclp9tX/cEFIGvhuOTZUR 6401S= and then the browser will know to pop-up a download dialog.

    A 1 Reply Last reply
    0
    • D Daniel Fiske

      If I have a database that has a whole lot of files in it that are incoded in BASE64. Is there some way I can return them straight to HTML so the browser knows to it is downloading a file....e.g. I want to return the BLOB so that I am really returning an HTML page to the person will see www.xyz.com/download.asp and download.asp contains something like Content-Type: application/octet-stream; name="test.exe" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="test.exe" qANQR1DBwA4DXCexCm8KkTsQAv9wDCPX+7o05gnUq0hH5nEPofQ5a8bpnx82OqvmgKCd65fBIbz9 8GjkmslBrB9N+LU7G0RMbhIZFYHcoqOMW1Jje64UR/6TLQ/61Fw+v/j0bsPXU8/ACdb0tX9kNjR8 C/0C/0k7nBcylnZmMHrYXeuGfjAnLjyXMu08+wCCCf0IYn6COEZObwCXlESgOXfIITMq44QJno91 w4enDZ5t0X9KewUrcVh8hUq4WKsXGPRI0DV5YlJEuNAImlf+DvL4DrtI9cHCTgPZ0XOtEPSlchAM AKIJh+R2vswfQheAla7fkLp1hqShCra1DkXTdU41EHfwf9EVmOs2d9ovLuFWnH8ukqh8BYNjXuxK Rfo13mMXqRQBW5b0pKcVPONOcokD2mDaKiuYIbmwm6A+I9LUfAoxg9tj6IrF1LxL53Ysq3FMxqh0 OJKg5iYpBqnhCVgUon6p/Fn41onF9HVhbxZsdRTpIum9YjctoMGNb3DTclp9tX/cEFIGvhuOTZUR 6401S= and then the browser will know to pop-up a download dialog.

      A Offline
      A Offline
      Arup
      wrote on last edited by
      #2

      Personally, I haven't come across such an issue as yours, but I found the following ASP/Vbscript sample code in MSDN.. Response.ContentType = “image/gif” Set cnnPubs = Server.CreateObject(“ADODB.Connection”) cnnPubs.Open “pubs”, “sa” Set rstPub_Info = cnnPubs.Execute(“SELECT logo FROM pub_info WHERE _ pub_id=’1389'”) Response.BinaryWrite rstPub_Info(“logo”) Response.End The idea is to stream out the blob contents to the browser. The example above is probably just a trivial one. Please follow up to “Delivering Web Images from SQL Server,” by Scott Stanfield (MIND, July 1998) for more info. MIND is at www.microsoft.com/mind. Check out "Top Ten Tips Accessing SQL Through ADO and ASP" By J.D. Meier in MSDN. Hope that helps.. regards Arup

      A 1 Reply Last reply
      0
      • A Arup

        Personally, I haven't come across such an issue as yours, but I found the following ASP/Vbscript sample code in MSDN.. Response.ContentType = “image/gif” Set cnnPubs = Server.CreateObject(“ADODB.Connection”) cnnPubs.Open “pubs”, “sa” Set rstPub_Info = cnnPubs.Execute(“SELECT logo FROM pub_info WHERE _ pub_id=’1389'”) Response.BinaryWrite rstPub_Info(“logo”) Response.End The idea is to stream out the blob contents to the browser. The example above is probably just a trivial one. Please follow up to “Delivering Web Images from SQL Server,” by Scott Stanfield (MIND, July 1998) for more info. MIND is at www.microsoft.com/mind. Check out "Top Ten Tips Accessing SQL Through ADO and ASP" By J.D. Meier in MSDN. Hope that helps.. regards Arup

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

        I'm sorry about those emoticons.. they were not intentional.

        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