Don't hardcode a file system path. What the IIS virtual path "/images" maps to on your machine
isn't what it will map to on another server....
<% Function ShowFolderList() %>
<select name="image" size="1">
<option value="No Image">No Image</option>
<%
Dim fso, f, f1, fc
Set fso = CreateObject ("Scripting.FileSysObj")
Set f = fso.GetFolder (Server.MapPath("/images"))
Set fc = f.Files
For Each f1 in fc
%>
option value="<% response.write f1.name %>">
<% response.write f1.name %>
</option>
<% Next %>
</select>
<% End Function %>
--
Michael Harris
MVP Scripting
Hi!
I'm looking for a way to let the owner of a
site update some images, I use FSO (FileSystem object).
I have used the code below with no problems
when I use PWS (Personal Web Server).
I have sent over the stuff to the webb server now,
and made sure that this kind of action is allowed
on the server.
If I put:
<%= server.mappath("\images")%>
I get:
"G:\wwwroot\bort2\images"
I use the above string when I try to get to my images,
but I keep getting:
800a004c Path not found
Below, the function that create the dropdown list with
the images (filenames), quite straight forward I hope.
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
<% Function ShowFolderList() %>
<select name="image" size="1">
<option value="No Image">No Image</option>
<%
Dim fso, f, f1, fc
Set fso = CreateObject ("Scripting.FileSysObj")
Set f = fso.GetFolder ("G:\wwwroot\bort2\images")
Set fc = f.Files
For Each f1 in fc
%>
option value="<% response.write f1.name %>">
<% response.write f1.name %>
</option>
<% Next %>
</select>
<% End Function %>
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
My question to you guys....I'm I to blame, or
do we have a problem with our server...???..
I must have a good answer, so I can be convincing
when I call the server administrator...:))
Please help...
Kennet Carlsen
* Sent from AltaVista http://www.altavista.com Where you can also find related Web Pages, Images,
Audios, Videos, News, and Shopping. Smart is Beautiful