Have succesfully downloaded a variable number of .jpg image filenames into a variable dimension array. Can print these out as text successfully so can verify data is sound.
How do I use the array [RawFileNames()] as a valid entry in an <img src= ??????? alt="Anything" title="Anything" />
As you will see from the sample code which follows I am no professional, just a guy who wants to produce a simple solution to a personal project :-
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>FTCW</title>
'<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
</head>
<body bgcolor="#FFFFAA">
<%
Dim RawFileNames()
Dim RawFileCount
set ftp = Server.CreateObject("Chilkat.Ftp2")
success = ftp.UnlockComponent("Any Code")
If (success <> 1) Then
Response.write ftp.LastErrorText & "<br>"
End If
ftp.Hostname = "*************"
ftp.Username = "*************"
ftp.Password = "*************"
' Connect and login to the FTP server.
success = ftp.Connect()
If (success <> 1) Then
Response.write ftp.LastErrorText & "<br>"
End if
' Change to Data Directory
success = ftp.ChangeRemoteDir("/public_html/RawData")
If (success <> 1) Then
Response.write ftp.LastErrorText & "<br>"
End If
' Just get the active .jpg files - no directories
ftp.ListPattern = "*.jpg"
' How many files have we got?
n = ftp.NumFilesAndDirs
If (n < 0) Then
Response.write "Error - *** " & ftp.LastErrorText & "<br>"
End If
' Redimension the array to take all file names and
' then store all the file names in the array
Redim RawFileNames(n+1)
If (n > 0) Then
For i = 0 To n - 1
RawFileNames(i) = ftp.GetFilename(i)
Next
End If
%>
' Display first two images together with their titles doctored from the file name.
<div id="container">
<ul>
<li>
<% imagename = "images/" & RawFileNames(0)
Response.Write "<img src= imagename alt=""Photo One"" title=""1st Picture"" width=""110"" height=""60""/> "
Response.Write "<br>"
myString = RawFileNames(0)
PictureDate = Mid(myString,InStr(MyString,"_")+7,2) & "/" & Mid(myString,InStr(MyString,"_")+5,2) & "/" & Mid(myString,InStr(MyString,"_")+1,4)
'"<br>"
Response.write WeekDayName(WeekDay(picturedate)) & " - " & DatePart("d",PictureDate) & " " & MonthName(DatePart("m", PictureDate)) & " " & DatePart("yyyy",PictureDate) '& " at "
Response.Write " at " & Mid(myString,InStr(MyString,"_")+9,2) & ":" & Mid(myString,InStr(MyString,"_")+11,2)
Response.Write " " & "<br>"
%>
<br>
</li>
<li>
<img src= "images" & RawFileNames(1) alt="Photo Two" title="2nd Picture" width="110" height="60" />
<br>
<%
myString = RawFileNames(1)
PictureDate = Mid(myString,InS