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. Allow downloading of PDF w/o revealing URL to web user

Allow downloading of PDF w/o revealing URL to web user

Scheduled Pinned Locked Moved ASP.NET
question
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.
  • J Offline
    J Offline
    Josh Blair
    wrote on last edited by
    #1

    Hello, Does anyone have a simple way to provide a web user the ability to download binary files like PDF and EXE without revealing the path to these files? Basically I'm trying to hide the URL so the web user doesn't get a clue as to the directory structure that the files are stored on. -- modified at 14:10 Thursday 2nd March, 2006 Also, some of these documents are the type of documents that can load directly into the web browser: PDF, DOC, XLS. I also need to hide the URL if loaded directly into the browser. Thanks for your time and information, Josh Blair Evergreen, CO

    J 1 Reply Last reply
    0
    • J Josh Blair

      Hello, Does anyone have a simple way to provide a web user the ability to download binary files like PDF and EXE without revealing the path to these files? Basically I'm trying to hide the URL so the web user doesn't get a clue as to the directory structure that the files are stored on. -- modified at 14:10 Thursday 2nd March, 2006 Also, some of these documents are the type of documents that can load directly into the web browser: PDF, DOC, XLS. I also need to hide the URL if loaded directly into the browser. Thanks for your time and information, Josh Blair Evergreen, CO

      J Offline
      J Offline
      Jon Sagara
      wrote on last edited by
      #2

      You could try this[^], though they could capture the page headers and extract the path. You could also direct them to a page that loads the file into memory and then writes it out directly to the response stream. Jon Sagara Look at him. He runs like a Welshman. Doesn't he run like a Welshman? Doesn't he? I think he runs like a Welshman. Sagara.org | Blog | My Articles

      G 1 Reply Last reply
      0
      • J Jon Sagara

        You could try this[^], though they could capture the page headers and extract the path. You could also direct them to a page that loads the file into memory and then writes it out directly to the response stream. Jon Sagara Look at him. He runs like a Welshman. Doesn't he run like a Welshman? Doesn't he? I think he runs like a Welshman. Sagara.org | Blog | My Articles

        G Offline
        G Offline
        Guffa
        wrote on last edited by
        #3

        Jon Sagara wrote:

        You could also direct them to a page that loads the file into memory and then writes it out directly to the response stream.

        Even better; the file can be opened as a stream and fed right into the output stream of the response. This preserves memory if the files are large. --- b { font-weight: normal; }

        J 1 Reply Last reply
        0
        • G Guffa

          Jon Sagara wrote:

          You could also direct them to a page that loads the file into memory and then writes it out directly to the response stream.

          Even better; the file can be opened as a stream and fed right into the output stream of the response. This preserves memory if the files are large. --- b { font-weight: normal; }

          J Offline
          J Offline
          Josh Blair
          wrote on last edited by
          #4

          Guffa, Jon, Thanks for the tips. Do you know if these techniques work in IE, Firefox, AOL, and other browsers? I forgot to mention that this solution needs to be supported by an extensive list of browsers. Thanks again, Josh Blair Evergreen, CO

          G 1 Reply Last reply
          0
          • J Josh Blair

            Guffa, Jon, Thanks for the tips. Do you know if these techniques work in IE, Firefox, AOL, and other browsers? I forgot to mention that this solution needs to be supported by an extensive list of browsers. Thanks again, Josh Blair Evergreen, CO

            G Offline
            G Offline
            Guffa
            wrote on last edited by
            #5

            Yes, it does. The browser can't even tell the difference, apart from the file name. As long as you set the correct mime type of the response, the browser shouldn't care what the file name is. --- b { font-weight: normal; }

            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