473,385 Members | 1,622 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Password on specific file

I have made a secure website which you can only get access to
with right username and password. On this webpage I have some
links to some pdf-files, but how can I avoid people from getting
the file if they are not logged on first? As it is now they can
easily get the file if they just know the exact URL-address, ex:
www.website.com/dir/file1.pdf

If people type the URL above I would like them to be redirected
to the logon-page first.

I can't use components or MS-Access database, so I'm looking for
another solution. Hope somebody can help me.

Best regards

Lars

Jul 19 '05 #1
7 1418
"Lars Thomsen Nielsen" <la**@EraseThisflexcom.dk> wrote in message
news:41********************@news.sonofon.dk...
I have made a secure website which you can only get access to
with right username and password. On this webpage I have some
links to some pdf-files, but how can I avoid people from getting
the file if they are not logged on first? As it is now they can
easily get the file if they just know the exact URL-address, ex:
www.website.com/dir/file1.pdf

If people type the URL above I would like them to be redirected
to the logon-page first.

I can't use components or MS-Access database, so I'm looking for
another solution. Hope somebody can help me.


Place the PDF file outside the web root so it does not have a URL and call
an ASP that uses ADODB.Stream and Response.BinaryWrite to serve the file
(after the user has passed your authentication).

http://support.microsoft.com/default...88&Product=asp

--
Tom Kaminski IIS MVP
http://www.microsoft.com/windowsserv...y/centers/iis/
http://mvp.support.microsoft.com/
http://www.iisfaq.com/
http://www.iistoolshed.com/ - tools, scripts, and utilities for running IIS
http://www.tryiis.com
Jul 19 '05 #2
> Place the PDF file outside the web root so it does not have a
URL and
call an ASP that uses ADODB.Stream and Response.BinaryWrite to serve the file (after the user has passed your authentication).


How do I place the file outside the web root? As I see it I can't
goto a "lower" path than the place where the index.htm is. On my
webserver there are however paths called "_vti_bin", "_vti_cnf",
"_vti_pvt" etc. I don't much about these, but is it one of these
you are talking about?

PS. I heard that reading files using BinaryRead should be a very
slow way to get large files. Is that correct?

Lars
Jul 19 '05 #3
Lets say you are using the default location for your root web of
"C:\Inetpub\wwwroot" (just for arguments sake). You are being told not
to put it in that folder or any of it's sub folders.

So basically put it in a folder like this one "C:\downloads". Then it
will be out of the web. Those _vti* folders are created by the
FrontPage Server extensions.

Lars Thomsen Nielsen wrote:
Place the PDF file outside the web root so it does not have a


URL and
call an ASP that uses ADODB.Stream and Response.BinaryWrite to


serve
the file (after the user has passed your authentication).

How do I place the file outside the web root? As I see it I can't
goto a "lower" path than the place where the index.htm is. On my
webserver there are however paths called "_vti_bin", "_vti_cnf",
"_vti_pvt" etc. I don't much about these, but is it one of these
you are talking about?

PS. I heard that reading files using BinaryRead should be a very
slow way to get large files. Is that correct?

Lars


Jul 19 '05 #4
> So basically put it in a folder like this one "C:\downloads".
Then it
will be out of the web.


OK, I might have to say that I don't own the webserver. I have
bought space on a webhotel, so as I see it I can't create a
folder as you described since I don't have access to the C-drive,
or am I wrong?

Lars
Jul 19 '05 #5
"Lars Thomsen Nielsen" <la**@EraseThisflexcom.dk> wrote in message
news:41********************@news.sonofon.dk...
So basically put it in a folder like this one "C:\downloads".

Then it
will be out of the web.


OK, I might have to say that I don't own the webserver. I have
bought space on a webhotel, so as I see it I can't create a
folder as you described since I don't have access to the C-drive,
or am I wrong?


You're probably right. Contact your host to discuss your options.

--
Tom Kaminski IIS MVP
http://www.microsoft.com/windowsserv...y/centers/iis/
http://mvp.support.microsoft.com/
http://www.iisfaq.com/
http://www.iistoolshed.com/ - tools, scripts, and utilities for running IIS
http://www.tryiis.com
Jul 19 '05 #6
> You're probably right. Contact your host to discuss your
options.

They are to cheap, so they don't give that kind of support...

Thanks for your suggestions though.

If somebody comes up with an alternative solution I would be glad
to hear about it.

Lars
Jul 19 '05 #7
If it's a PDF file you created, you can enter a username & password into
the file itself, so that without the password the file is useless.

Lars Thomsen Nielsen wrote:
You're probably right. Contact your host to discuss your


options.

They are to cheap, so they don't give that kind of support...

Thanks for your suggestions though.

If somebody comes up with an alternative solution I would be glad
to hear about it.

Lars


Jul 19 '05 #8

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

Similar topics

6
by: Lou | last post by:
Please can someone put me out my misery! Im trying to find a multiple user/password protection script that will redirect the specific user to a specific directory. At the moment I have set up...
12
by: Pat A | last post by:
We have a dilemma. We are storing our database password in an include file that resides outside of the web root. The password is in plain text. So, no one can get that password because it can't...
3
by: MissiMaths | last post by:
I have used outputTo to export a copy of a table out of access into excel. I was wondering if there is anyway to set a password on this within the code so that it is read only in .xls format? I...
11
by: Pflanzen Gold | last post by:
Hi, When entering a password we don't really see the characters - we see **** instead. How can I write such a routine in C? How can I 'echo off' the inputs? How can I get a characters/strings...
3
by: Ahmet AKGUN | last post by:
Hi; In my application, I must hold database password in a configuration file at client. Two questions, * Is there way to keep password easily using an ini file structure ? ( I cant use...
3
by: Funky | last post by:
Hi, I have developed an ASP.NET application which has been running in production for around 3 months without any major glitches. Recently, a user was attempting to upload a rather large CSV file...
7
by: Willem Herremans | last post by:
I am developing a client application for postgreSQL in Tcl/Tk (see http://gborg.postgresql.org/project/pfm ). It mainly uses PgTcl or pgintcl. I don't have any problems with those, but I am also...
4
by: Alvaro G. Vicario | last post by:
I’m writing a web application that needs to keep passwords in a database. These passwords are for third-party services and are different from the regular login passwords. I don’t like...
12
by: =?Utf-8?B?am9uaWdy?= | last post by:
I wrote a simple VB.NET application that imports and edits CSV files. Now I’d like to “lock” the raw (pre-import) CSV files so these cannot be opened separately. It is not high-sensitive...
22
by: teejayem | last post by:
Hi, I am new to programming with databases and was wanting some help. Is there any way to password protect an access database and access sent sql commands to it via vb.net code? Any help...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.