how to prevent everybody seen my files

Discussion in 'C#' started by greekhand, Oct 26, 2007.

  1. #1
    hi ,

    let's say i have directory called "Games" when some 1 go to

    ....com/Games , he can see all my files , what can i do ?

    thanks .
     
    greekhand, Oct 26, 2007 IP
  2. gota

    gota Peon

    Messages:
    20
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Make a empty file called "default.htm" and place that in that directory, or turn off directory browsing at the server level TAB -> "Home Directory" uncheck the "Directory browsing" checkbox!
     
    gota, Oct 26, 2007 IP
  3. yourihost

    yourihost Well-Known Member

    Messages:
    1,708
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    115
    #3
    Normaly it is index.html.
     
    yourihost, Oct 26, 2007 IP
  4. gota

    gota Peon

    Messages:
    20
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    "default.htm" is the default and first extension that IIS creates when making virtiual host or the default web site. The only time it wouldn't be is if you remove the "default content pages" all together or remove it from the list. In fact ".html" has never been a default IIS content page extension, it was "index.htm" up until IIS 4, then it became "Default.htm", and is still that way, although "index.htm" is also included in the list, but there is still no default "*.html".
     
    gota, Oct 26, 2007 IP
  5. greekhand

    greekhand Active Member

    Messages:
    248
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #5
    wow , great ideas , ty very much .
     
    greekhand, Oct 26, 2007 IP
  6. teraeon

    teraeon Peon

    Messages:
    40
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #6
    If you're using asp.net you can also configure a web.config file to not allow non-members from seeing any files within the directory. But that will not solve it for you for non-members.

    Another route is to turn of read permissions completely in IIS, and then create a HTTP handler which spits out the game upon request from your calling page.
     
    teraeon, Nov 1, 2007 IP
  7. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #7
    web.config will only stop viewing of files which go through the .Net engine. As standard jpg, mp3, pdf, html, asp (not aspx obviously) dont and therefore would still be visible.

    If you have access to IIS you can push everything through the .Net engine to enable .config to protect all the content but this will increase the load on the server
     
    AstarothSolutions, Nov 1, 2007 IP
  8. teraeon

    teraeon Peon

    Messages:
    40
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Whoops sorry, my mistake I don't know why I wrote it that way. What I meant to say was that you should put the files in a directory outside of IIS or shut off the read permissions, then create a HTTP handler which resides within a configured web directory.
     
    teraeon, Nov 1, 2007 IP