Click to See Complete Forum and Search --> : List files of a Remote URL


mch
09-10-2003, 10:56 AM
I need to list files of a remote url. The situation is like this...
My code resides on a server and the data, the code retrieves, is on a different server. I need to list the folders of a particualr directory in the second server from my code. I can do if code and data reside on the same server using FileSystemObject. But I am stuck on this. Could someone help me with this? It would be greatly appreciated.

Thanks
MCH

rdoekes
09-11-2003, 11:45 AM
If your servers are networked, you could create a share on your the computer where your code resides, and use the FileSystemObject to access that shared drive

mch
09-11-2003, 12:02 PM
Thank you. It worked.
These are intranet sites. But when the code goes to production machine, wouldn't the server that has the code be mapped to the data server inorder to access the data like this. Would it be possible to use an URL.
Eg:
Whichfolder="J:\temp\"
This works :-)

Could we do something like this..
<%
Whichfolder=server.mappath("\") &"http://data.website.com/dataFolder/prod/"
response.write("Which folder "& whichfolder)
Dim fso, d, f1, fc
Set fso = CreateObject("Scripting.FileSystemObject")
Set d = fso.GetFolder(Whichfolder)
Set fc = d.files

For Each f1 in fc
Response.write (f1.name & "<BR>")
Next
%>

Thanks again

rdoekes
09-11-2003, 03:30 PM
Whichfolder=server.mappath("\") &"http://data.website.com/dataFolder/prod/"
I do not think this is possible. But since you are talking about intranet sites, you could go with shares...

-Rogier Doekes

mch
09-11-2003, 03:41 PM
Thanks