Password on specific file

  • Thread starter Lars Thomsen Nielsen
  • Start date
L

Lars Thomsen Nielsen

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
 
T

Tom Kaminski [MVP]

Lars Thomsen Nielsen said:
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.aspx?scid=kb;en-us;276488&Product=asp

--
Tom Kaminski IIS MVP
http://www.microsoft.com/windowsserver2003/community/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
 
L

Lars Thomsen Nielsen

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
 
J

Joker

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.
 
L

Lars Thomsen Nielsen

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
 
T

Tom Kaminski [MVP]

Lars Thomsen Nielsen said:
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/windowsserver2003/community/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
 
L

Lars Thomsen Nielsen

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
 
J

Joker

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.
 

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

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top