The problem with the article is that you have to muck about with IIS. I don't
have that option in a hosted environment. Also, there is no protected
database subdirectory.
I don't think the ForbiddenHandler will work, since he does not have
access to IIS (to map file types to the ASPNET ISAPI).
The only solution I can think of is to store the files as binary data in
a database. SQL Server and Oracle have specifica column types for this
purpose. You would then create a custom httphandler (.ashx file, since
you cannot map a new file type) that handles retrieving the file data
from the database and sending it to the Response output stream. You can
figure out which file to retrieve using a querystring.
Note, in the databse table, you will want to at least store the
filename, file contents (binary), and content type (so that you can set
the Response.ContentType when you return the data).
Protect them from whom? Do you have access to anyone else's hosted files on
the server? If not, what makes you think anyone else has access to yours?
And if nobody has access, in what way do you need to additionally protect
them?
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.