ASP FSO and Javascript Slideshow

Some EE wizard wrote the attached. It renders our the image but does not switch images. I have no thumbs, just 10 jpegs in a folder.

These are images taken of the first hole of our golf course.  I'm using an X10 camera and software to automagically take and upload the pics to our web server.

I need then to somehow manage the uploaded images by periodically deleting all but the 10 most recent. I've heard Powershell is in order for this kind of work, but I'm not familiar with it. I have full control of the web server.  Any help or other ideas welcome.
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Slideshow</title>          
<%
 response.write  "<scri" & "pt language=javascript>"    &  vbcrlf
 response.write  "var delta = 10;"   &  vbcrlf
 response.write  "var picno = 1;"   &  vbcrlf
 response.write "var  pictures  = new Array();"   &  vbcrlf
 response.write "var  titles    = new Array();"   &  vbcrlf

thumbFilePath = "http://www.jennco.com/avgcwebcam/"
imageFilePath = "http://www.jennco.com/avgcwebcam/"
strPhysicalPath="E:\web\users\jennco\avgcwebcam\"

Set fso = CreateObject("Scripting.FileSystemObject")
set mainfolder=fso.GetFolder(strPhysicalPath)
Set filecollection = mainfolder.Files
intTotPics = 0
For Each file In filecollection
      response.write "pictures[" & cstr(intTotPics) & " ] = '" & file.name  & "';"  &  vbcrlf
      response.write "titles[" & cstr(intTotPics) & " ] = '" & fso.getbasename(strPhysicalPath & file.name)  & "';"  &  vbcrlf
      if intTotPics = 0 then
        sFirstPic = file.name
        sFirstTitle = fso.getbasename(strPhysicalPath & file.name)
      End If
  intTotPics = intTotPics + 1
Next
%>                                              

function init()  {
    setInterval("FadeInOut(MyTable);", 10)
}  

function FadeInOut(obj)  {                  
    if ((obj.filters.alpha.opacity + delta > 100)
    ||  (obj.filters.alpha.opacity + delta < 0))  {
         if(obj.filters.alpha.opacity  + delta <= 0) {  
      // faded out, now change it      
    document.images("PicImg").src = "<%=imageFilePath%>" + pictures[picno];
    document.all.item("PicTitle").innerText = titles[picno];
          if (picno == pictures.length - 1) picno = 0;
          else picno++;        
    }    
        delta = - delta;                                            
    }
    obj.filters.alpha.opacity += delta;
}
</script>
</head>

<body onLoad="init()">  
<center>
<%Response.Write Ucase(mainfolder.Name)%>
<span id=MyTable  style="width:100%; filter:alpha(opacity=100); text-align:center;" >
<table border='0' cellpadding='4'>
<tr>
<td align="center">
<img id="PicImg" src='<%=imageFilePath & sFirstPic%>'>
</td>
</tr>
<tr>
 <td align="center">
<div id="PicTitle">
<%response.write sFirstTitle%>
</div>
</td>
</tr>
</table>
</span>
</body>

</html>

Open in new window

webdorkAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
webdorkConnect With a Mentor Author Commented:
I simplified to just show the most recent image.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<style type="text/css">
img
{
position:absolute;
left:0px;
top:0px;
z-index:-1;
border-style:solid;
border-width:1px;
}
</style>

<title>AVGC WebCam</title>          
<%
set oFolder=createobject("scripting.filesystemobject").getfolder("E:\web\users\******\******")
For Each aFile In oFolder.Files
    If sNewest = "" Then
        Set fNewest = aFile
        sNewest = aFile.Name
    Else
        If fNewest.DateCreated < aFile.DateCreated Then
            Set fNewest = aFile
        End If
    End If
Next


%>                                              

</head>

<body>  

<div>
<img src="http://www.******.com/******/<%response.write fNewest.Name%>">
<div style="padding-left:15px;padding-top:200px;color:#FFFFFF; font-weight:bold;">
<%response.write DATEADD("h",-3,fNewest.DateCreated) 
%>


</div>
</div>

</body>

</html>

Open in new window

0
 
amit_gCommented:
Post the rendered code i.e. run it in the browser and do View Source and post that.
0
 
amit_gCommented:
How come that is a solution :) If you resolved it yourself, post the solution here and accept that as an answer.
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
webdorkAuthor Commented:
Didn't know i could.  
0
 
webdorkAuthor Commented:
I was just so grateful that someone finally responded after 6 days.
0
 
webdorkAuthor Commented:
simplified
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.