E
Eugene Anthony
I am having a problem with this code. The problem I am facing is that
the first image is displayed in its original size. But when I click the
next button, the next image not displayed in its original size, but
being displayed as 100 x 100 pixels, same goes to the 3rd picture and so
on. How do I solve the problem.
<%Option Explicit%>
<!--#INCLUDE FILE="inc_Common.asp" -->
<%
On Error Resume Next
Folder = Request("Folder")
FileNbr = Request("imgNbr")
ImageFilePath = myFolder + "/" + Request("Folder")
counter = 0
lImgCounter = 0
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder(Server.MapPath(ImageFilePath))
For Each objFile In objFolder.Files
strFileExtension = LCase(Mid(objFile.Name, InStrRev(objFile.Name, ".",
-1, 1) + 1))
If strFileExtension = "gif" Or strFileExtension = "jpg" Then
If (CLng(counter) = CLng(FileNbr)) then
imgCurrentBaseName = objFSO.GetBaseName(objFile.Name)
lImgCounter = lImgCounter + 1
ShowImageLink = "<img src=""" & myFolder & "/" & Folder & "/" &
objFile.Name & """ vspace=""15"" hspace=""15"" border=""0""" & """>"
CurrentFileName = objFSO.GetBaseName(objFile.Name)
FileNameSpaces = Replace(CurrentFileName,"_"," ")
End If
counter = counter + 1
End If
Next
%>
<html>
<head>
<title>Full Image</title>
</head>
<body bgcolor="#000000">
<div align="center">
<table border="0" cellpadding="0" cellspacing="0" width="*"
align="center">
<tr>
<td>
<table border="0" cellpadding="0" cellspacing="0" width="100%"
align="center">
<tr>
<td class="header" align="left" width="10"><img
src="icons/td_top_left.gif" width="8" height="20" border="0"></td>
<td class="header" align="left" width="*"><font
class="PopTitle"><%= FileNameSpaces %></font></td>
<td class="header" align="right" width="80" valign="center">
</td>
<td class="header" align="right" width="10"><img
src="icons/td_top_right.gif" width="8" height="20" border="0"></td>
</tr>
</table>
<table cellpadding="2" cellspacing="0" border="0" width="100%">
<tr>
<td align="center">
<%
Response.Write ShowImageLink
ThumbNextLink = CLng(FileNbr) + 1
ThumbPreviousLink = CLng(FileNbr) - 1
%>
</td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%"
align="center">
<tr>
<td class="middle" align="left" width="10"><img
src="icons/td_bot_left.gif" width="8" height="20" border="0"></td>
<% If (CLng(FileNbr)) > 0 Then %>
<td class="middle" align="left" width="80">
<A href="show.asp?Folder=<%= Folder %>&imgNbr=<%=
ThumbPreviousLink %>" class="links">Previous</A>
</td>
<% End If %>
<td class="middle" align="center" width="*"> </td>
<% If (CLng(FileNbr) < (CLng(counter)) - 1) Then %>
<td class="middle" align="right" width="55">
<A href="show.asp?Folder=<%= Folder %>&imgNbr=<%= ThumbNextLink
%>" class="links">Next</A>
</td>
<% End If %>
<td class="middle" align="right" width="10"><img
src="icons/td_bot_right.gif" width="8" height="20" border="0"></td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
<%
Set objFSO = Nothing
Set objFolder = Nothing
%>
Eugene Anthony
the first image is displayed in its original size. But when I click the
next button, the next image not displayed in its original size, but
being displayed as 100 x 100 pixels, same goes to the 3rd picture and so
on. How do I solve the problem.
<%Option Explicit%>
<!--#INCLUDE FILE="inc_Common.asp" -->
<%
On Error Resume Next
Folder = Request("Folder")
FileNbr = Request("imgNbr")
ImageFilePath = myFolder + "/" + Request("Folder")
counter = 0
lImgCounter = 0
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder(Server.MapPath(ImageFilePath))
For Each objFile In objFolder.Files
strFileExtension = LCase(Mid(objFile.Name, InStrRev(objFile.Name, ".",
-1, 1) + 1))
If strFileExtension = "gif" Or strFileExtension = "jpg" Then
If (CLng(counter) = CLng(FileNbr)) then
imgCurrentBaseName = objFSO.GetBaseName(objFile.Name)
lImgCounter = lImgCounter + 1
ShowImageLink = "<img src=""" & myFolder & "/" & Folder & "/" &
objFile.Name & """ vspace=""15"" hspace=""15"" border=""0""" & """>"
CurrentFileName = objFSO.GetBaseName(objFile.Name)
FileNameSpaces = Replace(CurrentFileName,"_"," ")
End If
counter = counter + 1
End If
Next
%>
<html>
<head>
<title>Full Image</title>
</head>
<body bgcolor="#000000">
<div align="center">
<table border="0" cellpadding="0" cellspacing="0" width="*"
align="center">
<tr>
<td>
<table border="0" cellpadding="0" cellspacing="0" width="100%"
align="center">
<tr>
<td class="header" align="left" width="10"><img
src="icons/td_top_left.gif" width="8" height="20" border="0"></td>
<td class="header" align="left" width="*"><font
class="PopTitle"><%= FileNameSpaces %></font></td>
<td class="header" align="right" width="80" valign="center">
</td>
<td class="header" align="right" width="10"><img
src="icons/td_top_right.gif" width="8" height="20" border="0"></td>
</tr>
</table>
<table cellpadding="2" cellspacing="0" border="0" width="100%">
<tr>
<td align="center">
<%
Response.Write ShowImageLink
ThumbNextLink = CLng(FileNbr) + 1
ThumbPreviousLink = CLng(FileNbr) - 1
%>
</td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%"
align="center">
<tr>
<td class="middle" align="left" width="10"><img
src="icons/td_bot_left.gif" width="8" height="20" border="0"></td>
<% If (CLng(FileNbr)) > 0 Then %>
<td class="middle" align="left" width="80">
<A href="show.asp?Folder=<%= Folder %>&imgNbr=<%=
ThumbPreviousLink %>" class="links">Previous</A>
</td>
<% End If %>
<td class="middle" align="center" width="*"> </td>
<% If (CLng(FileNbr) < (CLng(counter)) - 1) Then %>
<td class="middle" align="right" width="55">
<A href="show.asp?Folder=<%= Folder %>&imgNbr=<%= ThumbNextLink
%>" class="links">Next</A>
</td>
<% End If %>
<td class="middle" align="right" width="10"><img
src="icons/td_bot_right.gif" width="8" height="20" border="0"></td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
<%
Set objFSO = Nothing
Set objFolder = Nothing
%>
Eugene Anthony