FSO (FileSystem object) 
Author Message
 FSO (FileSystem object)

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.*-*-*.com/ Where you can also find related Web Pages, Images, Audios, Videos, News, and Shopping.  Smart is Beautiful



Mon, 16 Sep 2002 03:00:00 GMT  
 FSO (FileSystem object)
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



Mon, 16 Sep 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. performance of FileSystem-object

2. FileSystem Object Read Order

3. filesystem object

4. Problem with filesystem object

5. Filesystem Object

6. Filesystem Object

7. Filesystem object UNC Path Error

8. Problems with Filesystem object Copy method

9. FileSystem Object

10. Filesystem object

11. GetFolder method for FileSystem Object not working on Win2000

12. FileSystem Object Network Path Error

 

 
Powered by phpBB® Forum Software