Allow ASPX but no Downloading?

  • Thread starter Thread starter xeroxero
  • Start date Start date
X

xeroxero

I would like to prevent people from downloading a .zip from a ASP.NET
2.0 web site, but still allow people to touch a .aspx page in the same
directory. I also want to set things so if a user clicks on a button,
the ASP.NET page will facilitate a download with Response.BinaryWrite.

Is that possible?

Thanks.
 
You could put the file outside of the web site itself, or buried in another
odd directory that the user would never guess. The easiest way to prevent a
user from finding it is to put it where they're not looking. Just try
creating a series of oddly named directories to put the file in then
binarywrite it from there.
 
It may be over kill but I would look into HttpHandlers... This will
allow you to handle ZIP files differently from others. I do something
similar for my training videos. I have the asx files (which don't
exist) and when one is accessed one is sent (the HttpHandler creates
the data and sends it... there are no real asx files, but the world
still seems them). Many people do the samething to block people from
downloading images from their site.
 
What about putting it in a subdirectory of App_Data? Doesn't ASP.NET
protect that by default from browsers? Or if a file goes there I can't
read and binarywrite() it?
 

Ask a Question

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.

Ask a Question

Back
Top