Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Password Protection
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Password Protection

 Post Reply Post Reply
Author
dwhite02 View Drop Down
Newbie
Newbie


Joined: 10 October 2004
Status: Offline
Points: 33
Post Options Post Options   Thanks (0) Thanks(0)   Quote dwhite02 Quote  Post ReplyReply Direct Link To This Post Topic: Password Protection
    Posted: 15 October 2008 at 3:48am
Is there a way to password protect access to files such as PPS/PPT & PDF in an IIS without the need to apply security to the files themselves or directory security?

I am using ASP with a DB backend to log users onto the site and determine which links that they have access to but I am concerned about them passing on direct URL's to the no web page files.

Any suggestions on how to do this? Is it even possible?

Thanks.
Back to Top
mhanif View Drop Down
Groupie
Groupie
Avatar

Joined: 22 November 2007
Location: Pakistan
Status: Offline
Points: 52
Post Options Post Options   Thanks (0) Thanks(0)   Quote mhanif Quote  Post ReplyReply Direct Link To This Post Posted: 15 October 2008 at 7:21am
Those PPT PDF etc files are available for download for your logged members ? And you want only your logged members to download them ?  Or those files are not for download, they open it through IE.
Back to Top
WebWiz-Bruce View Drop Down
Admin Group
Admin Group
Avatar
Web Wiz Developer

Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post Posted: 15 October 2008 at 9:43am
You could use the ADO.Stream object to stream the files to the user using an ASP page.

This way you can place the files on the server in a non public directory, you then use an ASP page to stream the files. The ASP page can then have extra checking, like to check if the user is logged in.
Back to Top
dwhite02 View Drop Down
Newbie
Newbie


Joined: 10 October 2004
Status: Offline
Points: 33
Post Options Post Options   Thanks (0) Thanks(0)   Quote dwhite02 Quote  Post ReplyReply Direct Link To This Post Posted: 20 October 2008 at 12:09am
Thanks Bruce,
 
I have got the PDF streaming sorted, but am having problems with the PPS/PPT files as the code below is forcing a file a download diolouge for the ASP file. Any suggestions?
 
Thanks
 
------
 
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%
dim path
path = request.QueryString("file")
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<%
Response.ContentType = "application/mspowerpoint"
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Type = 1
objStream.Open
objStream.LoadFromFile "e:\xxx\xxx\" + path  'outside web root
Response.BinaryWrite objStream.Read
objStream.Close
Set objStream = Nothing
%>
</body>
</html>
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.