Re: ASP Script Hangs
From: Roland Hall (nobody_at_nowhere)
Date: 03/23/05
- Next message: Aaron [SQL Server MVP]: "Re: ASP design question"
- Previous message: Roland Hall: "ASP design question"
- In reply to: Roland Hall: "Re: ASP Script Hangs"
- Next in thread: Andi B: "Re: ASP Script Hangs"
- Reply: Andi B: "Re: ASP Script Hangs"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 23 Mar 2005 15:54:40 -0600
"Roland Hall" wrote in message
news:%23MC1p29LFHA.1948@TK2MSFTNGP14.phx.gbl...
: "Andi B" wrote in message
: news:4241bf6b$0$26751$cc9e4d1f@news.dial.pipex.com...
:: For Each objFile in strCurrentFolder.Files
:
: for each objFile in objFolder.Files
Actually you have more than one error. FSO expects a physical path, not
virtual. You need Server.MapPath and my first suggestion.
I just tried this and it works. Just change the name of your folders. I'm
using "/images"
<%@ Language=VBScript %>
<%
Option Explicit
Response.Buffer = True
Dim objFSO
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Dim objFolder
Dim strCurrentFolder
strCurrentFolder = Server.MapPath("/images")
Set objFolder = objFSO.GetFolder(strCurrentFolder)
Dim objFile
For Each objFile in objFolder.Files
Response.Write objFile.Name & " (" & objFile.Size & "bytes)<br>"
Next
Set objFSO = Nothing
Set objFolder = Nothing
%>
http://kiddanger.com/lab/files3.asp
-- Roland Hall - some days are easier than others - /* This information is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. */
- Next message: Aaron [SQL Server MVP]: "Re: ASP design question"
- Previous message: Roland Hall: "ASP design question"
- In reply to: Roland Hall: "Re: ASP Script Hangs"
- Next in thread: Andi B: "Re: ASP Script Hangs"
- Reply: Andi B: "Re: ASP Script Hangs"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|