Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
| Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old November 7th, 2007, 05:35 AM
Registered User
Join Date: Nov 2007
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default preventing download for un registered user

I've a zip file on my web server for download. I've made a link to that file and authenticate the user. But If user knows that link and use direct link in browser window he can access that.
How can I authenticate if user use direct link to that file.
Please help me

  #2 (permalink)  
Old November 7th, 2007, 09:02 AM
Authorized User
Join Date: Jan 2007
Location: Islamabad, Punjab, Pakistan.
Posts: 93
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to aliirfan84

There my be many ways to cope this:

1) You can use session variable
2) Can check URL Referrer(I think in ur case it wil work fine along with session)

Ali Irfan

  #3 (permalink)  
Old November 8th, 2007, 10:19 AM
Registered User
Join Date: Nov 2007
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts

User is accessing the URL Like
then where can I check URL Referrer, because he is accessing the file directly from browser. Kindly tell me in detail I'm new to web development.

  #4 (permalink)  
Old November 8th, 2007, 10:35 AM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons

This seems like a strange request. Are you trying to prevent unauthenticated users from accessing the file or are you trying to prevent direct access to the file?

In the case of the former you could setup a web.config for the directory the Zip file is in to only allow authenticated users to access its contents.


================================================== =========
Read this if you want to know how to get a correct reply for your question:
================================================== =========
.: Wrox Technical Editor :.
Wrox Books 24 x 7
================================================== =========

Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting User registered and Users online motemape BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 3 May 25th, 2007 08:14 PM
Download user created controls? tourlou C# 1 March 15th, 2007 11:44 AM
Preventing user from closing form lizhaskin Access 3 December 21st, 2005 01:01 PM
Check if user is registered for email updates brettdalldorf ASP.NET 1.0 and 1.1 Basics 4 July 8th, 2005 10:01 AM
user ability to download a file elladi Classic ASP Basics 3 April 1st, 2005 07:40 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.