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. Setting file access restrictions...

Setting file access restrictions...

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netsysadminxmlhelp
4 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.
  • D Offline
    D Offline
    dekart_roo
    wrote on last edited by
    #1

    For an asp.net application, I'm using an xml file to read in configuration settings. The problem is... some of the settings can hold sensitive data. I want to ensure that the application can read in the values, but that the server will not acknowledge any http requests on the file. Prior programming conventions would dictate placing the configuration file somewhere outside of the scope of the web root, but that makes for more difficult installations... I'm trying to keep the whole application limited to one directory. So... is there a web.config setting I could use to grant server access to a file, but not http access?

    B 1 Reply Last reply
    0
    • D dekart_roo

      For an asp.net application, I'm using an xml file to read in configuration settings. The problem is... some of the settings can hold sensitive data. I want to ensure that the application can read in the values, but that the server will not acknowledge any http requests on the file. Prior programming conventions would dictate placing the configuration file somewhere outside of the scope of the web root, but that makes for more difficult installations... I'm trying to keep the whole application limited to one directory. So... is there a web.config setting I could use to grant server access to a file, but not http access?

      B Offline
      B Offline
      Bassam Saoud
      wrote on last edited by
      #2

      You can use the location element in ASP.NET 2.0 (not sure about previous versions) MSDN[^]

      D 1 Reply Last reply
      0
      • B Bassam Saoud

        You can use the location element in ASP.NET 2.0 (not sure about previous versions) MSDN[^]

        D Offline
        D Offline
        dekart_roo
        wrote on last edited by
        #3

        Thanks a lot; knowing this is definitely a big piece of the puzzle, as it will surely be how I target the specific file. But I'm still unsure of the specific configuration that will instruct IIS to reject http requests for that file, while still allowing server requests. -Roo

        B 1 Reply Last reply
        0
        • D dekart_roo

          Thanks a lot; knowing this is definitely a big piece of the puzzle, as it will surely be how I target the specific file. But I'm still unsure of the specific configuration that will instruct IIS to reject http requests for that file, while still allowing server requests. -Roo

          B Offline
          B Offline
          Bassam Saoud
          wrote on last edited by
          #4

          Try this:

            `<location path="YOUR_FILE_NAME.aspx"> 		<system.web> 			<authorization> 				<deny users="?"/> 			</authorization> 		</system.web> 	</location>`
          
          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