473,385 Members | 1,392 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.

File protection

I need to be able to secure files on my web server. I am using asp to
secure access to links and pages, for example:

<%If Session("manager")=FALSE Then%>
You are not authorized to view this page
<%Else%>
<<<Page Code>>>
<%End If%>

The place I'm running into problems is with files. I have a lot of
charts and such in PDF version. I kind of doubt there is a way to
secure these files with asp, but I thought it would be worth a try. My
biggest issue is that PDFs are stored in the browser's history, so once
the page has been accessed, anyone using the browser can get to that
unsecured PDF. As a brute force fix, is there some way to simply erase
the site from the browser history? If not, is there a way to secure
the PDF, or does someone know of a better group to post on? Thanks!

Apr 18 '06 #1
2 1194
Greg wrote on 18 apr 2006 in microsoft.public.inetserver.asp.general:
I need to be able to secure files on my web server. I am using asp to
secure access to links and pages, for example:

<%If Session("manager")=FALSE Then%>
You are not authorized to view this page
<%Else%>
<<<Page Code>>>
<%End If%>

The place I'm running into problems is with files. I have a lot of
charts and such in PDF version. I kind of doubt there is a way to
secure these files with asp, but I thought it would be worth a try. My
biggest issue is that PDFs are stored in the browser's history, so once
the page has been accessed, anyone using the browser can get to that
unsecured PDF. As a brute force fix, is there some way to simply erase
the site from the browser history? If not, is there a way to secure
the PDF, or does someone know of a better group to post on? Thanks!


You can try to start an .pdf or .jpg with:

<%If NOT Session("manager")="ok" Then server.transfer "/404.asp"%>

No Newline after the %> !!!

If the bitstream of the file contains no <% then this usually works

=================

Second option:

put the .pdf ot whatever in a directory outside the root,
or at least in a directory with a secret name.
Then send the file with:
<% ' myPdf.asp

If Session("manager")="ok" Then

pdf "/secretdirectoryQWERTYUIOP/myPdf.pdf"

function pdf(strFileName)
Response.Clear
strFilePath=server.mappath(strFilename)
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Open
objStream.Type = 1
objStream.LoadFromFile strFilePath
Response.ContentType = "application/pdf"
Response.BinaryWrite objStream.Read
objStream.Close
Set objStream = Nothing
Response.end
end function

end if

response.status = "404 Not Found" ' so searchbots will go away

%>
<html>
<body style='font-size:30pt;'>
No admittance! ;-(
</body>
</html>
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Apr 18 '06 #2
keep the files outside of the web or in a folder no ones knows the location
of
the stream the files to logged in users... whch wil keep the file locations
secret to everyone

www.aspin.com has some god examples on streaming from as code as well as a
lot of nice FREE asp login managers
www.aspprotect.com is a also good place to look if you are lokin for
something that can handle all of this for you including the streaming

"Greg" <GC*******@gmail.com> wrote in message
news:11*********************@g10g2000cwb.googlegro ups.com...
I need to be able to secure files on my web server. I am using asp to
secure access to links and pages, for example:

<%If Session("manager")=FALSE Then%>
You are not authorized to view this page
<%Else%>
<<<Page Code>>>
<%End If%>

The place I'm running into problems is with files. I have a lot of
charts and such in PDF version. I kind of doubt there is a way to
secure these files with asp, but I thought it would be worth a try. My
biggest issue is that PDFs are stored in the browser's history, so once
the page has been accessed, anyone using the browser can get to that
unsecured PDF. As a brute force fix, is there some way to simply erase
the site from the browser history? If not, is there a way to secure
the PDF, or does someone know of a better group to post on? Thanks!

Apr 18 '06 #3

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

Similar topics

5
by: Dave Smithz | last post by:
Hi There, I have a PHP script that sends an email with attachment and works great when provided the path to the file to send. However this file needs to be on the same server as the script. ...
1
by: Naeem Sarfraz | last post by:
I understand this file is under protection but how do I remove it from the 'detected dependencies' in the Installer project. The error message: 'shdocvw.dll' should be excluded because its...
9
by: Howard | last post by:
I am currently looking at the various packages that are available for software protection. I have a particular question that I'd welcome your feedback on. Background info: I work for a company...
0
by: SoftComplete Development | last post by:
SoftComplete Development Updates EXECryptor to v. 2.1.20 Software piracy! Cracked serial numbers! Thousands of commercial products are posted on the warez sites and become available to all who...
3
by: Bill | last post by:
Using ASP in a VBScript environment, how can I check the protection on a directory, or a particular file?
2
by: Maziar Aflatoun | last post by:
Hi, I'm trying to protect one of my subfolders from Web.config file in my root folder. Here is my directory structure / // My shopping cart /admin // Shopping cart...
1
by: Malik Asif Joyia | last post by:
Hello I want to implement the forms based authentication. for a sub directory in my webapplication. I have allready applied Forms based authentication in my webapplication ,, I have added a folder...
1
by: Rotsen | last post by:
HI people, I am trying to read a file using "file" and I am passing the following string for the input file parameter:...
13
by: NickName | last post by:
"For the vision impaired, SVG offers tremendous potential for interactive Internet mapping applications as discussed by Gardner and Bulatov (2001).". Now, here's an SVG file with fair/medium...
0
by: dba | last post by:
Hi folks, I would just like to share with you SQL CodeSecure, a newly released database protection and auditing tool from SqlLabs: SQL CodeSecure provides ultimate protection from unauthorized...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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.