PC Review


Reply
Thread Tools Rate Thread

For certain directories, protecting files from direct access that match a naming pattern OR mediating http access through my app

 
 
Ken Fine
Guest
Posts: n/a
 
      31st Jul 2007
Short version: I want to know how in ASP.NET I could bar direct http access
to some files in a directory that match a pattern, but not others. An
alternate solution would be to bar all direct http access to files and
require that any access of the files be mediated by my web application. In
other words, direct access via http://domain.com/app/MyCoolPhoto.jpg would
be forbidden.

Long version: I've written a photo cms and display application that has
organized many tens of thousands of files. It has made different versions of
those files, some of which I am willing to offer to the general public and
most of which I'm not:

jid20040632_pid400017_wissnerslivkachair_001_ld50.jpg
// OK to show to the world
jid20040632_pid400017_wissnerslivkachair_001_ld400watermarked.jpg //
Also OK, it's watermarked
jid20040632_pid400017_wissnerslivkachair_001_fullsized.jpg
// NOT OK! Keep this files matching "..._fullsized" off limits!
[multiply this by 20 other variations.]

I want to limit access to most of those variations. In some cases I imagine
I will be doing that limiting via ASP.NET 2 roles and in other cases I will
be inspecting ServerVariables that are assigned by the Pubcookie auth
framework.

Can someone suggest a server-side approach that works with ASP.NET and that
can't be easily defeated?

Thanks,
-KF


 
Reply With Quote
 
 
 
 
Steve C. Orr [MCSD, MVP, CSM, ASP Insider]
Guest
Posts: n/a
 
      31st Jul 2007
I've documented all you need to know on this subject here:
http://dotnetslackers.com/articles/a...ileDenial.aspx

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net



"Ken Fine" <(E-Mail Removed)> wrote in message
news:f8m0ue$msf$(E-Mail Removed)...
> Short version: I want to know how in ASP.NET I could bar direct http
> access to some files in a directory that match a pattern, but not others.
> An alternate solution would be to bar all direct http access to files and
> require that any access of the files be mediated by my web application. In
> other words, direct access via http://domain.com/app/MyCoolPhoto.jpg would
> be forbidden.
>
> Long version: I've written a photo cms and display application that has
> organized many tens of thousands of files. It has made different versions
> of those files, some of which I am willing to offer to the general public
> and most of which I'm not:
>
> jid20040632_pid400017_wissnerslivkachair_001_ld50.jpg // OK to show to the
> world
> jid20040632_pid400017_wissnerslivkachair_001_ld400watermarked.jpg //
> Also OK, it's watermarked
> jid20040632_pid400017_wissnerslivkachair_001_fullsized.jpg // NOT OK! Keep
> this files matching "..._fullsized" off limits!
> [multiply this by 20 other variations.]
>
> I want to limit access to most of those variations. In some cases I
> imagine I will be doing that limiting via ASP.NET 2 roles and in other
> cases I will be inspecting ServerVariables that are assigned by the
> Pubcookie auth framework.
>
> Can someone suggest a server-side approach that works with ASP.NET and
> that can't be easily defeated?
>
> Thanks,
> -KF
>


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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 On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Access to directories and files =?Utf-8?B?VG9tIFBhcmtl?= Windows Vista Administration 1 12th Nov 2007 03:29 PM
Access Denied on Restored Directories & Files =?Utf-8?B?SiBHcmFj?= Windows XP Help 2 28th Jul 2006 09:03 PM
VBA - Looping thro same naming files in 2 directories........PLEASE HELP Manju Microsoft Excel Programming 0 10th Mar 2006 03:26 PM
Slow access to files in sub directories dkrohn Microsoft Word Document Management 1 21st Dec 2003 05:42 AM
Recovering files from access denied directories Claude SA Windows XP Security 3 10th Oct 2003 06:37 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:17 PM.