PDA

View Full Version : Useing ASP folder object to read all files in the folder on the server


caribbeanf1
07-10-2007, 05:41 AM
Hi All, can nayone assist me with this issue.
I cam trying create a simply online photo album and are trying to asp folder object to read the image files from a folder, but I am not being successful.

Here is what I did:





<%
Dim fs,fo
Set fs=Server.CreateObject("Scripting.FileSystemObject")
Set fo=fs.GetFolder("\powellsvacation")for each x in fo.files
'Print the name of all files in the test folder
Response.write(x.Name &amp; "[b]")
nextset fo=nothing
set fs=nothing
%>


set fo=nothing
set fs=nothing
%>

bruce
07-10-2007, 07:38 AM
Try change this line

Set fo=fs.GetFolder("\powellsvacation")

to

Set fo = fs.GetFolder(server.mappath("\powellsvacation"))

Bruce

DiscountASP.NET
www.DiscountASP.NET (http://www.DiscountASP.NET)

caribbeanf1
07-10-2007, 07:59 AM
Thanks Bruce, I will try that.