for the showing fotos use this:
make a file called getfile.aspand insert this:
<!--#INCLUDE FILE="config.asp" -->
<!--#INCLUDE FILE="base64.asp"-->
<%
'############### site pass beginn
If InStr(Request.ServerVariables("HTTP_REFERER"),"pop_photo_view.asp") or _
InStr(Request.ServerVariables("HTTP_REFERER"),"photo_album_view.asp") then
'############### site pass end
select case Request.QueryString("view")
'############### get image beginn
case "img"
FName = Request.QueryString("FName")
if Instr(FName,"/") then
UserFolder = Base64Decode(left(FName, Instr(FName,"/")-1))
FileName = right(FName, len(FName)-Instr(FName,"/"))
Response.Redirect ("../uploaded/" & UserFolder & "/" & FileName & "")
else
Response.Redirect ("../img/page/not_found.jpg")
end if
'############### get image end
'############### leacher beginn
case else
Response.Redirect ("../img/page/leacher.jpg")
end select
else
Response.Redirect ("../img/page/leacher.jpg")end If
'############### leacher end
%>
check the file pathes for your files (red marked)
==========================================
make a file called base64.aspand insert this:
<%
Const Base64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789~_"
Function Base64Encode(inData)
Dim cOut, sOut, I
For I = 1 To Len(inData) Step 3
Dim nGroup, pOut, sGroup
nGroup = &H10000 * Asc(Mid(inData, I, 1)) + _
&H100 * MyASC(Mid(inData, I + 1, 1)) + MyASC(Mid(inData, I + 2, 1))
nGroup = Oct(nGroup)
nGroup = String(8 - Len(nGroup), "0") & nGroup
pOut = Mid(Base64, CLng("&o" & Mid(nGroup, 1, 2)) + 1, 1) + _
Mid(Base64, CLng("&o" & Mid(nGroup, 3, 2)) + 1, 1) + _
Mid(Base64, CLng("&o" & Mid(nGroup, 5, 2)) + 1, 1) + _
Mid(Base64, CLng("&o" & Mid(nGroup, 7, 2)) + 1, 1)
sOut = sOut + pOut
Next
Select Case Len(inData) Mod 3
Case 1: '8 bit final
sOut = Left(sOut, Len(sOut) - 2) + "--"
Case 2: '16 bit final
sOut = Left(sOut, Len(sOut) - 1) + "-"
End Select
Base64Encode = sOut
End Function
Function MyASC(OneChar)
If OneChar = "" Then MyASC = 0 Else MyASC = Asc(OneChar)
End Function
Function Base64Decode(ByVal base64String)
Dim dataLength, sOut, groupBegin
base64String = Replace(base64String, vbCrLf, "")
base64String = Replace(base64String, vbTab, "")
base64String = Replace(base64String, " ", "")
dataLength = Len(base64String)
If dataLength Mod 4 <> 0 Then
Err.Raise 1, "Base64Decode", "Bad Base64 string."
Exit Function
End If
For groupBegin = 1 To dataLength Step 4
Dim numDataBytes, CharCounter, thisChar, thisData, nGroup, pOut
numDataBytes = 3
nGroup = 0
For CharCounter = 0 To 3
thisChar = Mid(base64String, groupBegin + CharCounter, 1)
If thisChar = "-" Then
numDataBytes = numDataBytes - 1
thisData = 0
Else
thisData = InStr(1, Base64, thisChar, vbBinaryCompare) - 1
End If
If thisData = -1 Then
Err.Raise 2, "Base64Decode", "Bad character In Base64 string."
Exit Function
End If
nGroup = 64 * nGroup + thisData
Next
nGroup = Hex(nGroup)
nGroup = String(6 - Len(nGroup), "0") & nGroup
pOut = Chr(CByte("&H" & Mid(nGroup, 1, 2))) + _
Chr(CByte("&H" & Mid(nGroup, 3, 2))) + _
Chr(CByte("&H" & Mid(nGroup, 5, 2)))
sOut = sOut & Left(pOut, numDataBytes)
Next
Base64Decode = sOut
End Function
%>
i use it to encode the member id so it is not so easy to decode the real folder of a file. further i use a "file_save_path" (a another folder) so the real path of a file looks like this http://192.168.0.9/files/ds9f7sda9f70asd5chu/1/file.txt
==========================================
on the page you want to see the image
include the base 64 for encode the "member folder"
and replace the <img ....... > tag with the "getfile.asp......" tag
to show the image only if you come from a page witch are allowed to show the image
e.g.
<!--#INCLUDE FILE="base64.asp"-->
<img name='img' src="getfile.asp?view=img&FName=<% = Base64Encode(M_Name) %>/image_file_name.jpg>
<