Home > Archive > MCSD > December 2001 > filesystemobject plzzz help!? :)





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author filesystemobject plzzz help!? :)
ddd

2001-11-30, 9:26 pm

can I use the FSO to access files in a directory that hasn't got HTTP access but resides on the web server? I was thinking that I would be able to write a script to use the FSO if a user had permissions to download files.

is this possible? if so, how?

would realllllyyyy appreciate ur help
focused

2001-12-03, 11:45 am

yes it's possible to access files in a folder on the server without http: ref.

First, you'll need to know the path to the file (On the web server itself)

Try this,
'OPEN ACCESS TO THE FILE SYSTEM
Set objFSO=Server.CreateObject("Scripting.FileSystemObject")
Foldername = WebLoc & ToolFileLoc & "Info And Resources"

foldername=Path to the folder where the files will be placed e.g On the server- \\severname\driveletter\folder
\
If objFSO.FolderExists(Foldername) Then
flgFolderExists = True
Set objFolders=objFSO.GetFolder(Foldername)
strFolderName="Info And Resources"
Else
Response.Write("The folder " & Foldername & " does not exist")
flgFolderExists = False
End If

Then in the body or a sub

If flgFolderExists = True Then
If objFolders<>"" Then
For Each objFiles In objFolders.Files
<a href="<%=Webserver file syntax - eg http:www.//testserver/%><%=strFoldername%>/<%=objFiles.Name%>"><%=objFiles.Name%></a>
And anything you want
Next
Else
Response.Write("<font class=AlertText> Sorry, No information exists at this time.</font>")
End If
Else
Response.Write("<font class=alerttext>Sorry, This folder is not available at this time.</font>")
End If


I hope this helps in any way. If it doesn't sorry for wasting your time
Sponsored Links





Free Braindumps | MCSE braindumps software forum

Copyright 2003 - 2008 examnotes.net