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. How to Display PDF in Browser ?

How to Display PDF in Browser ?

Scheduled Pinned Locked Moved ASP.NET
csharpdatabasecomhelp
7 Posts 3 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.
  • R Offline
    R Offline
    Rizwan Bashir
    wrote on last edited by
    #1

    I have a list of PDF files which are uploaded into the database. Now on way back I recieve bytes which I Flush to browser but it ether ask for open or save option or it display nothing. Please help in any VB.Net or C# . My Code is response.clear response.contenttype="application/pdf" response.flush //tried either of below but both doesnt work response.writebytes (myFileBytes) // OR after writing a file from bytes response.writefile(Filepath) Response.end Any help or suggestion ? Regards

    Rizwan Bashir ALM Soft[^]

    V C 2 Replies Last reply
    0
    • R Rizwan Bashir

      I have a list of PDF files which are uploaded into the database. Now on way back I recieve bytes which I Flush to browser but it ether ask for open or save option or it display nothing. Please help in any VB.Net or C# . My Code is response.clear response.contenttype="application/pdf" response.flush //tried either of below but both doesnt work response.writebytes (myFileBytes) // OR after writing a file from bytes response.writefile(Filepath) Response.end Any help or suggestion ? Regards

      Rizwan Bashir ALM Soft[^]

      V Offline
      V Offline
      Vasudevan Deepak Kumar
      wrote on last edited by
      #2

      Rizwan Bashir wrote:

      but both doesnt work

      Meaning?

      Vasudevan Deepak Kumar Personal Homepage Tech Gossips

      R 1 Reply Last reply
      0
      • V Vasudevan Deepak Kumar

        Rizwan Bashir wrote:

        but both doesnt work

        Meaning?

        Vasudevan Deepak Kumar Personal Homepage Tech Gossips

        R Offline
        R Offline
        Rizwan Bashir
        wrote on last edited by
        #3

        Meaning it does not display in browser which is my problem.

        Rizwan Bashir ALM Soft[^]

        1 Reply Last reply
        0
        • R Rizwan Bashir

          I have a list of PDF files which are uploaded into the database. Now on way back I recieve bytes which I Flush to browser but it ether ask for open or save option or it display nothing. Please help in any VB.Net or C# . My Code is response.clear response.contenttype="application/pdf" response.flush //tried either of below but both doesnt work response.writebytes (myFileBytes) // OR after writing a file from bytes response.writefile(Filepath) Response.end Any help or suggestion ? Regards

          Rizwan Bashir ALM Soft[^]

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

          If write file doesn't work, then you have serious issues. What's actually happening ? Try losing the clear and flush calls, you don't need them.

          Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

          R 1 Reply Last reply
          0
          • C Christian Graus

            If write file doesn't work, then you have serious issues. What's actually happening ? Try losing the clear and flush calls, you don't need them.

            Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

            R Offline
            R Offline
            Rizwan Bashir
            wrote on last edited by
            #5

            Thanks Christain It works with Firefox but does not work with IE 6.0.2x version. Any solutions for IE6 ? Thanks Alot

            Rizwan Bashir ALM Soft[^]

            C 1 Reply Last reply
            0
            • R Rizwan Bashir

              Thanks Christain It works with Firefox but does not work with IE 6.0.2x version. Any solutions for IE6 ? Thanks Alot

              Rizwan Bashir ALM Soft[^]

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

              I can't imagine why it wouldn't work, although I would use Response.BinaryWrite. Try that.

              Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

              R 1 Reply Last reply
              0
              • C Christian Graus

                I can't imagine why it wouldn't work, although I would use Response.BinaryWrite. Try that.

                Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

                R Offline
                R Offline
                Rizwan Bashir
                wrote on last edited by
                #7

                Same Story.. works with Firefox and does not work with IE6.. but surprisingly I tested it on IE7 and it works fine. I really dont know what is going on. Where i try on web with different pdf's available online they open directly in the IE 6 but not mine. Regards

                Rizwan Bashir ALM Soft[^]

                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