Code help???

Results 1 to 2 of 2

Thread: Code help???

  1. #1
    Join Date
    Dec 1969

    Default Code help???

    What it is, is that i would like to access a folder from a different server outside of the server which the code is saved in. <BR><BR>The code below should be changed i guess i have tried writing in the server name but this does not work.. help!!<BR><BR>Line 88:<BR><BR>sDirectory = "//servername" &#039;Where "sDirectory" is the top level browsable directory<BR><BR>Lines 125 to 155<BR>&#039;Get subfolder (sDir) from passed querystring<BR>sDir = sDirectory & Request.querystring("dir")<BR>sDir = trim(sDir)<BR>If right(sDir,1) &#060;&#062; "/" Then sDir = sDir & "/"<BR><BR>&#039;This next part of code keeps users from browsing directories outside of the shared.<BR>&#039;It puts the user back into the default directory.<BR><BR>sFolder = Server.MapPath( sDir )<BR>sDirFolder = Server.MapPath( sDirectory )<BR>sSubFolder = right(sDir,len(sDir)-len(sDirectory))<BR><BR>If instr( sFolder , sDirFolder ) = 0 Then <BR>sFolder = sDirFolder<BR>sSubFolder = ""<BR>sError = sError & " Path not authorized;" &#039;Does not authorise folders to be viewed outside share<BR>End If<BR><BR>&#039;This loads the file system and navigates to the shared folder.<BR>Set objFileObject = Server.CreateObject("Scripting.FileSystemObject")< BR>Set objFolder = objFileObject.GetFolder( sFolder )<BR><BR>&#039;If the folder cannot be found or has been misspelled we can use the following code<BR>If IsEmpty( objFolder ) Then <BR>sFolder = sDirFolder<BR>sSubFolder = ""<BR>sDir = sDirectory <BR>Set objFolder = objFileObject.GetFolder( sFolder )<BR>sError = sError & " Folder not found;"<BR><BR>End If <BR>

  2. #2
    Join Date
    Dec 1969

    Default REPOST! Cheeky bugger. <eop>


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts