I am using this code to navigate through available folders on a remote computer.
& lt;% @ language = VBScript% & gt; & Lt;% Options Clear Blur Sroot, sdir, sparent, objFSO, objfolder, objfile, objSubfolder, size% & gt; & Lt; Meta content = "Microsoft Visual Studio 6.0" name = generator & gt; & Lt ;! - Author: Adrian Forbes - & gt; & Lt;% s Root = "\\ iflblw-bpd-12 \ Vercon_IP-BPD-01 \ SOFT" sDir = Request ("Dir") sDir = sDir & amp; "\" Response Type "& lt; h1 & gt;" & Amp; SDIR & amp; "& Lt; / h1>" & Amp; Set VbCRLF objFSO = CreateObject ("Scripting.FileSystemObject") Restart Error on Set objFolder = objFSO.GetFolder (sRoot and sdir) if err.number & lt; & Gt; 0 Then Response. Type "Folder can not be opened" response. If you get an error at the end, then 0 sparent = objFSO.GetParentFolderName (objFolder.Path) 'Remove the contents of the sRoot from the front. This gives us the path to parents relative to the root folder. If the original folder is "c: webfilessubfolder1subfolder2" then we just want the "subfolder1subfolder2" sparent = mid (sParent, len (sRoot) + 1) response. Give Feedback. & Lt; Table range = "" 1 "" & gt; "Give a link to the original folder. It is just a link to this page, 'Pssing only the new folder as a parameter response.', & Lt; tr & gt; & lt; td colspan = 3 & gt; & Lt; a href = "" browse.asp? Dir = "& amp; Server. URLCode (Esperal) & amp; "" "& Gt; Basic Folder & lt; / a & gt; & lt; / td & gt; & lt; / tr & gt; & Amp; VbCRLF 'Now we want to loop through this subfolder in this folder, for each objSubFolder in objFolder.SubFolders and provide them a link Response.Write "& lt; tr> gt; Server.URLEncode (objFile.Name) & amp; "& Amp; dir =" & amp; Server.URLEncode (SDIR) & amp; "" "& Gt;" & Amp; ObjFile.Name & amp; "& Lt; / a & gt; & lt; / td> gt; & lt; td & gt; & Amp; Size & amp; "& Lt; / td> gt; & lt; td & gt;" & Amp; ObjFile.Type & amp; "& Lt; / td> gt; & lt; / tr & gt; & Amp; VbCRLF 'Next Response Type "& lt; / table & gt;" & Gt%;
I want to pass the folder path on a form to another page. Actually, this page should be called during the form filling. How do you pass the route?
For example, what do I want when a user wants to select a folder, then he clicks a button that calls this page. The folder path should be returned in the form if selected on the folder.
Any help is really appreciated.
You are already going through the folder path on your code:
& lt; A href = "" browse.asp? Dir = "& server.URLEncode (sDir and objSubFolder.Name) and" "" & gt; "& amp; objSubFolder.Name End" & lt; / A & gt;
On the browser.asp page you can find the folder using:
sDir = request ("Dir")
< / Pre>
Comments
Post a Comment