<%@ 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 &mdash; Robust Upload Demo &mdash; 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">Robust Upload Demo</a> &rarr; Uploaded Files</h1>

		<table cellspacing="0" rules="all" border="1" style="border-collapse:collapse;">
			<tr style="background-color:Gainsboro;font-weight:bold;">
				<td>File Name</td>
				<td>Size in Bytes</td>
				<td>Extension</td>
				<td>Last Write Time</td>
			</tr>
<%
'Delete source files.
Dim objFileSystem, objFolder, objFile

Set objFileSystem = Server.CreateObject("Scripting.FileSystemObject")

Set objFolder = objFileSystem.GetFolder(Server.MapPath(strGalleryPath))

For Each objFile In objFolder.Files
%>
			<tr>
				<td><a href="<%=strGalleryPath & EncodeFileName(objFile.Name)%>" target="_blank"><%=Server.HTMLEncode(objFile.Name)%></a></td>
				<td><%=objFile.Size%></td>
				<td><%=Server.HTMLEncode(objFileSystem.GetExtensionName(objFile.Name))%></td>
				<td><%=objFile.DateLastModified%></td>		    
			</tr>
<%

Next
%>
	    </table>
	</form>
</body>
</html>
