| Posted: 15 October 2008 at 3:55pm | IP Logged
|
|
|
Anton wrote:
Is it possible to see your problem online? And couldn't it happen that this pdf file got into browser cache? |
|
|
Hi Anton, I've setup a simple test and will PM you the URL. Please don't make the URL public, thanks. :)
All you need to do is run the test. I'm using IE 7.0.5730.13. Click on all three of the PDF links. They will display the bottom frame. Keep note of the LAST pdf you clicked. When you are done, leave the page, but don't close the browser. View your history pane and expand the test URL. You should see the test PDF's. You can directly hotlink the last PDF you looked at. It won't expire. The link only expires when the browser is closed.
The code is as follows:
Location of source files:
http://host_ip/HotLinkBlockerTest/
Location of PDF files and HotLink protected
http://host_ip/HotLinkBlockerTest/PDF/
Three files:
index.html
------------------------------------------------------------------
<html><head><title>HotLinkBlocker Test</title></head>
<frameset rows="180,*" frameborder=yes border=5> <frame name=r1 src="choosePDF.html" scrolling=no> <frame name=r2 src="displayPDF.asp" scrolling=no> </frameset>
</html>
------------------------------------------------------------------
choosePDF.html
<html> <head>
<script>
function DisplayThePDF(pdfID){ parent.r2.location = "displayPDF.asp?PDFName=Test"+pdfID+".pdf"; }
</script>
</head>
<body>
<h1>HotLinkBlocker Test</h1>
<br>
<h3> <a href="javascript:DisplayThePDF(1);">Display PDF 1</a> <br> <a href="javascript:DisplayThePDF(2);">Display PDF 2</a> <br> <a href="javascript:DisplayThePDF(3);">Display PDF 3</a> </h3>
</body>
</html>
------------------------------------------------------------------
displayPDF.asp
<% '------------------------------------------------------- ' Declare global script variables '-------------------------------------------------------
Dim gStrPDFName 'As String Dim gStrPDFPath 'As String
'------------------------------------------------------- ' '------------------------------------------------------- Sub ShowThePDF() %> <html> <head>
<title>Display PDF</title>
</head>
<body>
<center>
<h3><%=gStrPDFPath%></h3>
<% If gStrPDFName <> "NONE" Then %> <iframe name="reportPDF" src="<%=gStrPDFPath%>" width="100%" height="100%"></iframe> <% Else %> <h3>Please select a PDF from above.</h3> <% End If %>
</center>
</form> </body> </html> <% End Sub '------------------------------------------------------- ' '------------------------------------------------------- Sub Main()
gStrPDFName = Request.QueryString("PDFName") 'when the current action is null, set it to NONE If Len(gStrPDFName) = 0 Then gStrPDFName = "NONE" Else 'set the PDF path gStrPDFPath = "http://host_ip/HotLinkBlockerTest" &_ "/PDF/xxxxxxxxxxxxxxxx/" & gStrPDFName End If
Call ShowThePDF() End Sub
' Main function must always be last in the code '------------------------------------------------------- Call Main '------------------------------------------------------- %>
|