474,052 Members | 2,284 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Howto ? authorization to download files on an ASP .NET website

Hi

How can i only allow downloading a file if a user has logged in ?

I have an aspx page with links to downloadable files, a users needs to enter
a login/pw before he can see the page, but if he bookmarks the url's to the
download link, he can bypass the login page.

So my login / pw protects access to the page with downloads links but not to
the downloads itself..

How can i do this in ASP (2) NET ?
(I have seen some sites where an url to a download looked like some kind of
mangled name.)

(ps if commenting keep in mind i am only a beginner in ASP )
Johan
May 17 '07 #1
2 1121
Hi,

you need to map file extensions of known files to be protected in IIS to be
served by aspnet_isapi.dl l, That happens in IIS's management tools. IIS
means the administrative tool of Internet Information Services, the web
server on Windows platform.
--
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net
"Sagaert Johan" <RE************ *@hotmail.comwr ote in message
news:O$******** ******@TK2MSFTN GP06.phx.gbl...
Hi

How can i only allow downloading a file if a user has logged in ?

I have an aspx page with links to downloadable files, a users needs to
enter
a login/pw before he can see the page, but if he bookmarks the url's to
the
download link, he can bypass the login page.

So my login / pw protects access to the page with downloads links but not
to
the downloads itself..

How can i do this in ASP (2) NET ?
(I have seen some sites where an url to a download looked like some kind
of
mangled name.)

(ps if commenting keep in mind i am only a beginner in ASP )
Johan

May 17 '07 #2
Thanks

I did it and it works fine.!


"Teemu Keiski" <jo****@aspalli ance.comwrote in message
news:44******** *************** ***********@mic rosoft.com...
Hi,

you need to map file extensions of known files to be protected in IIS to
be
served by aspnet_isapi.dl l, That happens in IIS's management tools. IIS
means the administrative tool of Internet Information Services, the web
server on Windows platform.
--
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net
"Sagaert Johan" <RE************ *@hotmail.comwr ote in message
news:O$******** ******@TK2MSFTN GP06.phx.gbl...
Hi

How can i only allow downloading a file if a user has logged in ?

I have an aspx page with links to downloadable files, a users needs to
enter
a login/pw before he can see the page, but if he bookmarks the url's to
the
download link, he can bypass the login page.

So my login / pw protects access to the page with downloads links but
not
to
the downloads itself..

How can i do this in ASP (2) NET ?
(I have seen some sites where an url to a download looked like some kind
of
mangled name.)

(ps if commenting keep in mind i am only a beginner in ASP )
Johan

May 18 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1520
by: Owen Jenkins | last post by:
I've been using Dev's fantastic InetTransferLib to upload and download files via ftp. Now I'm using the http procedures to have my application download zip files from my website. Although the download process works OK, it adds a few bytes to the file during the download, so a 46k file becomes 52k. I can still open the file using Winzip, but cannot open it using my active X extraction system (ActiveXZip from www.hdse.com). I get an error...
1
2267
by: Owen Jenkins | last post by:
Reposting this message from last week since I have not had a reply so far. Hopefully someone will have an idea? --- I've been using Dev's fantastic InetTransferLib to upload and download files via ftp. Now I'm using the http procedures to have my application download zip files from my website. Although the download process works OK, it adds a few bytes to the file during the download, so a 46k file becomes 52k. I can still open the file...
1
5470
by: Roy | last post by:
Hi, I have a problem that I have been working with for a while. I need to be able from server side (asp.net) to detect that the file i'm streaming down to the client is saved completely/succsessfully on the client's computer before updating some metadata on the server (file downloaded date for instance) However, All examples i have tried, and all examples I have found that other people says works - doesn't work for me :-(
1
1845
by: sonu | last post by:
Mark is creating a website using ASP.NET. He is using Forms authentication for authenticating and authorizing users. He has the following layout of files and directories in his website: Root ....File Manager/ ....Files Employee/
1
1293
by: nick | last post by:
I have create a Asp.net 2.0 application empsite with form authorization. And I have create an entry in IIS application mapping: ..doc =C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll I tried http://localhost/empsite/Documents/BenefitsSummary.doc on IE and it will be redirected to login page. However, it does't redirect to login page and the url can download the file directly.
1
1800
by: RedStain | last post by:
CONTENTS summary setup error messages compensation attempts comment SUMMARY I have an IIS6.0 server which has recently been upgraded to ASP 2.0 as a result of some of the patch requirements of some products I have installed
5
3703
by: Khafancoder | last post by:
Hi guys, i am building a FileSharing website, i wanna allow users to be able using download managers such as DAP to download files from webserver but don't allow them to retrive files url... so i used Response.WriteFile but it won't trigger any download manager such as DAP or FlashGet i used this code :
3
1366
by: Jonathan Wood | last post by:
I have a subfolder on my Website that contains images. It also contains the web.config file shown below. When I access the site, I get the Login page as expected. But if I type in the URL of an image in the folder that contains images, the image is displayed in the browser. I don't understand why I am not prevented from seeing the contents of this folder since I have not been authenticated. Does it have something to do with the fact...
1
47571
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Many websites have a form or a link you can use to download a file. You click a form button or click on a link and after a moment or two a file download dialog box pops-up in your web browser and prompts you for some instructions, such as “open” or “save“. I’m going to show you how to do that using a perl script. What You Need Any recent...
0
12178
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
11623
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8727
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7886
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6677
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6877
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
5434
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4954
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3993
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.