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. Display word document in web page

Display word document in web page

Scheduled Pinned Locked Moved ASP.NET
databasehelp
2 Posts 2 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.
  • M Offline
    M Offline
    Member 4065472
    wrote on last edited by
    #1

    hi everybody i have looked evrywhere but cant find the solution for this.... i want to display word document stored in sql database and i want to show that document in browser....please help of point me in right direction thanks in advance...

    appu

    G 1 Reply Last reply
    0
    • M Member 4065472

      hi everybody i have looked evrywhere but cant find the solution for this.... i want to display word document stored in sql database and i want to show that document in browser....please help of point me in right direction thanks in advance...

      appu

      G Offline
      G Offline
      Gayani Devapriya
      wrote on last edited by
      #2

      Hi Appu, I assume you have saved the word doc in the SQL Server as a byte array... and here is the code.. byte[] byteArray = //Get your byte array - ( file content )and assign it here. string sFileName = //Get your fileName and assign it here Response.AppendHeader("Content-Type", "application/msword"); Response.AddHeader("Content-Disposition", "attachment; filename=" + sFileName); Response.BinaryWrite(byteArray); Response.End(); Hope it works Thx, Gayani

      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