Hi,
if a problem wiht the folowing script. i would like to diplay the results in tree rows, and i have no idea where to do this in the script. I would be very glad if someone can help me....
_______________ _______________ ______________
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<%
Dim strThisPage
strThisPage = Request.ServerV ariables("SCRIP T_NAME")
strThisPage = Right(strThisPa ge, Len(strThisPage ) - 1)
''Path To Folder That holds Files To Download Here
''Default is the current Folder
FILE_FOLDER = StripFileName(R equest.ServerVa riables("PATH_T RANSLATED"))
file_path ="72dpi/aussen/"
file_path300 ="300dpi/aussen/"
FILE_FOLDER = FILE_FOLDER & file_path
''Constants
Const adVarChar = 200
Const adInteger = 3
Const adDate = 7
Const adFileTime = 64
Const adNumeric = 131
%>
<HTML>
<HEAD>
<TITLE>Pressefo tos</TITLE>
</HEAD>
<BODY >
<TABLE BORDER=1 ID=tblFileData >
<%
strSortHeader = Request.QuerySt ring("sort")
IF strSortHeader = "" Then
Call GetAllFiles("")
Else
Call GetAllFiles(str SortHeader)
End IF
%>
</TABLE>
</BODY>
</HTML>
<%
Sub GetAllFiles(str SortBy)
Dim oFS, oFolder, oFile
Set oFS = Server.CreateOb ject("Scripting .FileSystemObje ct")
''Set Folder Object To Proper File Directory
Set oFolder = oFS.getFolder(F ILE_FOLDER)
Dim intCounter
intCounter = 0
IF strSortBy = "" Then ''UnSorted (default)
Dim FileArray()
ReDim Preserve FileArray(oFold er.Files.Count, 5)
For Each oFile in oFolder.Files
strFileName = oFile.Name
strFileType = oFile.Type
strFileSize = oFile.Size
strFilePath = oFile.Path
strFileDtMod = oFile.DateLastM odified
Image_Path = Server.URLEncod e(Server.MapPat h(file_path) &"\" & strfilename )
FileArray(intCo unter, 0) = strFileName
FileArray(intCo unter, 1) = "<a href=" & FILE_path & strfilename & " target=new > <img src=sendbinary. asp?image_path= " & image_path & _
"> </A>" & "<br><cente r>" _
& "<A HREF=''Download 2.asp?pathtest= " & file_path & "&filetest= " & strfilename &"'' ><img src=download72d pi_w.gif>" _
& "<A HREF=''Download 2.asp?pathtest= " & file_path300 & "&filetest= " & strfilename &"'' ><img src=download300 dpi_w.gif></center>"
intCounter = (intCounter +1)
Next
intRows = uBound(FileArra y, 1)
intCols = uBound(FileArra y, 2)
For x = 0 To intRows -1
Echo("<Tr>")
For z = 0 To intCols
If z > 0 Then
BuildTableCol(F ileArray(x, z))
End IF
Next
Echo("</Tr>")
Next
Else
''Sorted List
Set oRS = Server.CreateOb ject("ADODB.Rec ordset")
oRS.Fields.Appe nd "Name", adVarChar, 500
oRS.Fields.Appe nd "Type", adVarChar, 500
oRS.Fields.Appe nd "Size", adInteger
oRS.Fields.Appe nd "Path", adVarChar, 500
oRS.Fields.Appe nd "Date", adFileTime
oRS.Open
For Each oFile in oFolder.Files
strFileName = oFile.Name
strFileType = oFile.Type
strFileSize = oFile.Size
strFilePath = oFile.Path
strFileDtMod = oFile.DateLastM odified
oRS.AddNew
oRS.Fields("Nam e").Value = "<img src=" & strFilePath & strFileName & ">""<A HREF=" & Chr(34) & "startDownload. asp?File=" _
& Server.urlEncod e(strFilePath) & "&Name=" & Server.urlEncod e(strFileName) & "&Size=" & strFileSize & Chr(34) _
& " onMouseOver=" & Chr(34) & "self.status='' " & strFileName & "''; return true;" & Chr(34) _
& " onMouseOut=" & Chr(34) & "self.status='' ''; return true;" & Chr(34) & ">" & strFileName & "</A>"
oRS.Fields("Typ e").Value = strFileType
oRS.Fields("Siz e").Value = strFileSize
oRS.Fields("Pat h").Value = strFilePath
oRS.Fields("Dat e").Value = strFileDtMod
Next
oRS.Sort = strSortBy & " ASC"
Do While Not oRS.EOF
Echo("<TR>")
BuildTableCol(o RS("Name"))
BuildTableCol(o RS("Type"))
BuildTableCol(o RS("Size"))
BuildTableCol(o RS("Path"))
BuildTableCol(o RS("Date"))
Echo("</TR>")
oRS.MoveNext
Loop
oRS.Close
Set oRS = Nothing
End IF
EchoB("<B>" & oFolder.Files.C ount & " Files Available</B>")
Cleanup oFile
Cleanup oFolder
Cleanup oFS
End Sub
Function Echo(str)
Echo = Response.Write( str & vbCrLf)
End Function
Function EchoB(str)
EchoB = Response.Write( str & "<BR>" & vbCrLf)
End Function
Sub Cleanup(obj)
IF isObject(obj) Then
Set obj = Nothing
End IF
End Sub
Function StripFileName(s trFile)
StripFileName = Left(strFile, inStrRev(strFil e, "\"))
End Function
Sub BuildTableCol(s trData)
Echo("<TD CLASS=DataCol>" & strData & "</TD>")
End Sub
''Not implemented
Sub BuildTableRow(a rrData)
Dim intCols
intCols = uBound(arrData)
For y = 0 To intCols
Echo("<TD CLASS=DataCol>" & arrData(y) & "</TD>")
Next
End Sub
%>
_______________ _______________ ____
thaks for helping .... :-)
-----------------------------
This message is posted by http://Asp.ForumsZone.com