Ok what im trying to acheive is a ASp script that looks in a directory and lists the contents and displays the picture as a thumbnail then alink to the actualy full size image. You see what i mean by the code. Problem im stuck with i want the page to display 3 rows then create a new row of thumbnails. I have tried every combination and sometimes it displays 1 picture 3 times and sometimes just times out.
Its probbly just lack of sleep but could one of you chaps take a look and tell me where im going wrong?
<%
Dim objFileScripting, objFolder, coloum
Dim filename, filecollection, strDirectoryPath, strUrlPath
strDirectoryPath="c:\inetpub\wwwroot\reuben\gallery\thumbnails"
strUrlPath="/reuben/gallery/"
strThumbPath="/reuben/gallery/thumbnails/"
'get file scripting object
Set objFileScripting = CreateObject("Scripting.FileSystemObject")
'Return folder object
Set objFolder = objFileScripting.GetFolder("c:\inetpub\wwwroot\reuben\gallery\thumbnails")
'return file collection In folder
Set filecollection = objFolder.Files
'create the links
coloum = 0
Do While coloum = 3
For Each filename In filecollection
Filename=right(Filename,len(Filename)-InStrRev(Filename, "\"))
Response.Write "<img src=""" & strThumbPath & filename & """><A HREF=""" & strUrlPath & filename & """>" & filename & "</A>"
coloum = coloum + 1
'Next
If coloum = 3 Then
Response.Write "<BR>"
coloum = 0
End if
Next
Loop
%>
Question
mcloum
Hi all,
Ok what im trying to acheive is a ASp script that looks in a directory and lists the contents and displays the picture as a thumbnail then alink to the actualy full size image. You see what i mean by the code. Problem im stuck with i want the page to display 3 rows then create a new row of thumbnails. I have tried every combination and sometimes it displays 1 picture 3 times and sometimes just times out.
Its probbly just lack of sleep but could one of you chaps take a look and tell me where im going wrong?
Many thanks
Mike.
Link to comment
Share on other sites
0 answers to this question
Recommended Posts