SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Member
    Join Date
    Jan 2007
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Disable direct access of txt file on server?

    Hello people,

    first, I'm new with ASP...

    I have a page that have some included txt contenet on it...
    I use
    Code:
    <!--#include file="somefile.txt"-->
    for that,
    and it works fine, so that's cool.

    Now what I need is to disable direct opening of that somefile.txt file.

    So I want above code to work on page, as it is now, but I need to disable if someone types mysite.com/somefile.txt to open that file in the browser.

    So I guess I need to set something like HTTP acess for that file, but I have no clue how to do it on ASP server, so can you help me with this?..

    Or if you know any other solution for this (maybe somehow just to hide link from page source code so that visitors can't see where it is, but I think this is not possible)

  2. #2
    SitePoint Zealot
    Join Date
    Jan 2007
    Location
    Almere, The Netherlands
    Posts
    160
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Error404 View Post
    Hello people,

    Or if you know any other solution for this (maybe somehow just to hide link from page source code so that visitors can't see where it is, but I think this is not possible)
    I think you're missing the point of include files! When you inlcude a file, people that visit your asp page, won't see the path specified, but they will see the content of the text file

  3. #3
    SitePoint Author silver trophybronze trophy
    wwb_99's Avatar
    Join Date
    May 2003
    Location
    Washington, DC
    Posts
    10,576
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    You really shouldn't be using any #includes in ASP.NET, there are much better ways of handling this, such as master pages.

  4. #4
    Chopped Liver bronze trophy imaginekitty's Avatar
    Join Date
    Aug 2007
    Location
    Pennsyltucky
    Posts
    1,494
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by wwb_99 View Post
    You really shouldn't be using any #includes in ASP.NET, there are much better ways of handling this, such as master pages.
    I'm thinking this person is talking about classic ASP and is posting in the wrong forum. I'm not positive about that though.

  5. #5
    SitePoint Author silver trophybronze trophy
    wwb_99's Avatar
    Join Date
    May 2003
    Location
    Washington, DC
    Posts
    10,576
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Poor guy. Quoting the one team we still have maintaining the 1.5 ASP.ancient apps we have: "Dude, this is like sticking bamboo shoots up my fingernails. And I say that compared to sharepoint development."

  6. #6
    Chopped Liver bronze trophy imaginekitty's Avatar
    Join Date
    Aug 2007
    Location
    Pennsyltucky
    Posts
    1,494
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by wwb_99 View Post
    Poor guy. Quoting the one team we still have maintaining the 1.5 ASP.ancient apps we have: "Dude, this is like sticking bamboo shoots up my fingernails. And I say that compared to sharepoint development."
    Seriously, I was recently asked to maintain an old classic ASP sit that I made a few years back and I offered to update it to .NET for free if they'd only just let me. Luckily they did. I was so relieved.

  7. #7
    ALT.NET - because we need it silver trophybronze trophy dhtmlgod's Avatar
    Join Date
    Jul 2001
    Location
    Scotland
    Posts
    4,836
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I recently had to work on a bug in an ASP.acient site, forgotten how to do anything! Glad the days of working with that language are over! Having said that, .NET 1.x feels just as bad!

  8. #8
    SitePoint Author silver trophybronze trophy
    wwb_99's Avatar
    Join Date
    May 2003
    Location
    Washington, DC
    Posts
    10,576
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    I'd blame much more of 1.1's pain on VS 2003, particularly the web editor, rather than the framework itself. Yeah, I really couldn't imagine life without generics and I'm quickly falling in love with LINQ. But compared to that which went before it was a godsend.

    Also, I wouldn't trade alot of the experience I got diving real deep into the framework because you had to dive deep to do lots of stuff that is now handled with built-in features. It is amazing how few of the newer guys don't really grok stuff like IPrincipal, it's all hidden behind membership now.

  9. #9
    ALT.NET - because we need it silver trophybronze trophy dhtmlgod's Avatar
    Join Date
    Jul 2001
    Location
    Scotland
    Posts
    4,836
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    When I'm looking for contractors, the development test I give is to write a replacment for the membership providers using an ORM, really weeds out the boys from the men

  10. #10
    SitePoint Author silver trophybronze trophy
    wwb_99's Avatar
    Join Date
    May 2003
    Location
    Washington, DC
    Posts
    10,576
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Lol. That is actually a very good test, I'll keep that one in mind.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •