jon24422531
Technical User
I am struggling to understand why this does not work and I would appreciate some help.
On our Intranet I want to be able to list Word (.doc) and PDF files from a particular folder and enable the user to click the relevant entry and open the file.
It works with the D: (commented out) but that is all, and it does not work at all with a different server (\\Server26\BusinessData\)
I have tried every combination of backslash and forwardslash that I can think of. We even have it mapped (as an S: Drive) and that doesn't work either. All I get is Path Not Found.
I have also tried it with Server.MapPath
And the error is:
An invalid '/' or '\' was found in the Path parameter for the MapPath method.
Getting very confused.....
Jonathan
On our Intranet I want to be able to list Word (.doc) and PDF files from a particular folder and enable the user to click the relevant entry and open the file.
Code:
<%
Dim objFSO, objFile, objFolder
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
'Set objFolder = objFSO.GetFolder("D:\")
Set objFolder = objFSO.GetFolder("\\Server26\BusinessData\")
For Each objFile in objFolder.Files
Response.Write objFile.Name & "<br>"
Next
Set objFolder = Nothing
Set objFSO = Nothing
%>
I have tried every combination of backslash and forwardslash that I can think of. We even have it mapped (as an S: Drive) and that doesn't work either. All I get is Path Not Found.
I have also tried it with Server.MapPath
Code:
Set objFolder = objFSO.GetFolder(Server.MapPath("//Server26/BusinessData"))
An invalid '/' or '\' was found in the Path parameter for the MapPath method.
Getting very confused.....
Jonathan