<%@ language="VBScript" %>
<%
Response.Expires = 60
Response.ExpiresAbsolute = Now() - 2
Response.AddHeader "pragma", "no-cache"
Response.AddHeader "cache-control", "private"
Response.CacheControl = "no-cache"

'This variable specifies relative path to the folder, where the gallery with uploaded files is located.
'Do not forget about the slash in the end of the folder name.
Dim strGalleryPath
strGalleryPath = "../Gallery/"

Function EncodeFileName(value)
	EncodeFileName = Replace(Server.UrlEncode(value), "+", "%20")
End Function
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>Aurigma Image Uploader Demos &rarr; Server Imaging Demo &rarr; Uploaded Files</title>
	<link href="../common.css" type="text/css" rel="stylesheet" />
</head>
<body>
	<form>
		<h1><a href="../default.asp">Aurigma Image Uploader Demos</a> &rarr; <a href="default.asp">Server Imaging Demo</a> &rarr; Uploaded Files</h1>
		
		<div class="note">
			<h4>Note</h4>
			<p>
				Border is drawn only on original image, not on thumbnails.
				To see the modified image, click the thumbnail.		
			</p>
		</div>
		
		<table width='100%'>
<%			
Dim objDescriptions
Set objDescriptions = Server.CreateObject("Msxml2.DOMDocument.4.0")
objDescriptions.async = False
objDescriptions.load Server.MapPath(strGalleryPath & "Descriptions.xml")	

Dim intColCount
intColCount = 4

Dim i
For i = 0 To objDescriptions.documentElement.childNodes.length - 1
	Dim objXmlFile
	Set objXmlFile = objDescriptions.documentElement.childNodes(i)
	If i Mod intColCount = 0 Then
%>
			<tr>
<%		
	End If
%>
				<td>
					<a href="<%=strGalleryPath & EncodeFileName(objXmlFile.GetAttribute("name")) %>"
						target="_blank">
						<img src="<%=strGalleryPath & "Thumbnails/" & EncodeFileName(objXmlFile.getAttribute("name")) %>.jpg"
							alt="<%=Server.HTMLEncode(objXmlFile.getAttribute("name"))%>" />
					</a>
					<br />
					<br />
					<b>Name:</b>
					<%=Server.HTMLEncode(objXmlFile.getAttribute("name")) %>
					<br />
					<b>Dimensions:</b>
					<%=Server.HTMLEncode(objXmlFile.getAttribute("width")) %>
					x
					<%=Server.HTMLEncode(objXmlFile.getAttribute("height")) %>
					<br />
					<b>Description:</b>
					<%=Server.HTMLEncode(objXmlFile.getAttribute("description")) %>
				</td>
<%		
	If (i Mod intColCount = intColCount-1) Or _
		(i = objDescriptions.documentElement.childNodes.length - 1) Then
%>
			</tr>
<%	
	End If
	
Next
%>
		</table>
	</form>
</body>
</html>