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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. How to open PDF from server?

How to open PDF from server?

Scheduled Pinned Locked Moved ASP.NET
sysadmintutorialquestion
5 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
    raghvendrapanda
    wrote on last edited by
    #1

    I want to open Pdf file from iframe. i have used this code where i am taking path from my application. string strOutPutPath = "../MPMA/MPMA Inventory/" + Session["Filename"].ToString() + ".pdf"; ifrm1.Attributes.Add("src", strOutPutPath); Inside MPMA Inventory all pdf files are there. Session giving my filename. But this is perfectally working if i am taking path from my application. But if i want to take path from server what should i do?Like i want server path instead of "../MPMA/MPMA Inventory/".

    N 1 Reply Last reply
    0
    • R raghvendrapanda

      I want to open Pdf file from iframe. i have used this code where i am taking path from my application. string strOutPutPath = "../MPMA/MPMA Inventory/" + Session["Filename"].ToString() + ".pdf"; ifrm1.Attributes.Add("src", strOutPutPath); Inside MPMA Inventory all pdf files are there. Session giving my filename. But this is perfectally working if i am taking path from my application. But if i want to take path from server what should i do?Like i want server path instead of "../MPMA/MPMA Inventory/".

      N Offline
      N Offline
      Not Active
      wrote on last edited by
      #2

      raghvendrapanda wrote:

      i want server path

      What do you mean? Server.MapPath ??


      I know the language. I've read a book. - _Madmatt

      R 1 Reply Last reply
      0
      • N Not Active

        raghvendrapanda wrote:

        i want server path

        What do you mean? Server.MapPath ??


        I know the language. I've read a book. - _Madmatt

        R Offline
        R Offline
        raghvendrapanda
        wrote on last edited by
        #3

        The main problem is i am able to acess a pdf file in iframe only when itz saved in my project..i want to knw how to get the file and show it whn itz not saved in the project.

        N M 2 Replies Last reply
        0
        • R raghvendrapanda

          The main problem is i am able to acess a pdf file in iframe only when itz saved in my project..i want to knw how to get the file and show it whn itz not saved in the project.

          N Offline
          N Offline
          Not Active
          wrote on last edited by
          #4

          What do you mean not saved in the project? Are you trying to display a PDF from memory? Or is it located at a physical location? If the latter, then get the path and display it.


          I know the language. I've read a book. - _Madmatt

          1 Reply Last reply
          0
          • R raghvendrapanda

            The main problem is i am able to acess a pdf file in iframe only when itz saved in my project..i want to knw how to get the file and show it whn itz not saved in the project.

            M Offline
            M Offline
            Member 4501940
            wrote on last edited by
            #5

            The files do not have to be in 'my project' but they do have to be in an internet share that have the proper permsissions set. IIS and aspnet do not have full run of the OS and can not directly access server paths as you mentioned without punching some big holes in security. So. Create a share, set permissions and you are good to go.

            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