Reply
Disable direct access of txt file on server?
Old 06-15-2009, 02:34 PM Disable direct access of txt file on server?
Novice Talker

Posts: 9
Trades: 0
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 www.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)
Error404 is offline
Reply With Quote
View Public Profile
 
 
When You Register, These Ads Go Away!
Old 06-15-2009, 05:11 PM Re: Disable direct access of txt file on server?
Skilled Talker

Posts: 59
Name: Andy Dixon
Trades: 0
Simple solution chmod the file
__________________
Magmahost.com - Hosting Services. Since 2007
Shared $1.00 | Reseller $6.95 Click here to visit Magmahost.com
MH-Andy is offline
Reply With Quote
View Public Profile
 
Old 06-16-2009, 05:54 PM Re: Disable direct access of txt file on server?
Novice Talker

Posts: 14
Name: workhomeforum
Trades: 0
You cannot chmod the file in IIS as you can do that in Linux or Unix based systems.
workhomeforum is offline
Reply With Quote
View Public Profile
 
Old 06-16-2009, 06:39 PM Re: Disable direct access of txt file on server?
willcode4beer's Avatar
Super Moderator

Posts: 1,388
Name: Paul Davis
Location: San Francisco
Trades: 1
Just place the file outside of the web root
__________________
Paul Davis

earn $$$ write for willCode4Beer.com
willcode4beer is offline
Reply With Quote
View Public Profile
 
Old 06-20-2009, 09:05 PM Re: Disable direct access of txt file on server?
itHighway's Avatar
Skilled Talker

Posts: 73
Name: Zeeshan Dar
Location: GUJ
Trades: 0
If you have access to hosting control panel you can also set the Download and Viewing permissions on this file.
itHighway is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Disable direct access of txt file on server?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 



Page generated in 0.11591 seconds with 13 queries