A
Andi B
Hi folks,
Wondering if anyone can help me - I have recently set up a website on our
work intranet, which allows staff members in our team to attach a photo of
themselves to their profile on the page. The photos are uploaded to the
webserver by an ASP script. I am now trying to get an addition written
which allows for the deletion of old files that are no longer used by
anyones profile. I have written the following to list the contents of the
folder, but whenever I test the script on my home computer (WinXP Pro, SP2,
IIS 5.1) the ASP hangs - it produces no output, not even an error. Can
anyone offer any assistance on what I might need to do to get it working
correctly?
<%@ Language=VBScript %>
<%
Option Explicit
Dim objFSO
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Dim objFolder
Dim strCurrentFolder
strCurrentFolder = "images/staff"
Set objFolder = objFSO.GetFolder(strCurrentFolder)
Dim objFile
For Each objFile in strCurrentFolder.Files
Response.Write objFile.Name & " (" & objFile.Size & "bytes)<br>"
Next
Set objFSO = Nothing
Set objFolder = Nothing
%>
Thanks in advance of any assistance,
Andi
Wondering if anyone can help me - I have recently set up a website on our
work intranet, which allows staff members in our team to attach a photo of
themselves to their profile on the page. The photos are uploaded to the
webserver by an ASP script. I am now trying to get an addition written
which allows for the deletion of old files that are no longer used by
anyones profile. I have written the following to list the contents of the
folder, but whenever I test the script on my home computer (WinXP Pro, SP2,
IIS 5.1) the ASP hangs - it produces no output, not even an error. Can
anyone offer any assistance on what I might need to do to get it working
correctly?
<%@ Language=VBScript %>
<%
Option Explicit
Dim objFSO
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Dim objFolder
Dim strCurrentFolder
strCurrentFolder = "images/staff"
Set objFolder = objFSO.GetFolder(strCurrentFolder)
Dim objFile
For Each objFile in strCurrentFolder.Files
Response.Write objFile.Name & " (" & objFile.Size & "bytes)<br>"
Next
Set objFSO = Nothing
Set objFolder = Nothing
%>
Thanks in advance of any assistance,
Andi