
July 1st, 2000, 09:45 PM
|
|
Contributing User
|
|
Join Date: Dec 2002
Posts: 14,575
  
Time spent in forums: < 1 sec
Reputation Power: 22
|
|
|
virtual links buildup from file search
<i><b>Originally posted by : jason (jason707@pacbell.net)</b></i><br /><br /><br />Hello;<br /><br />I try to get virtual links for user's files from user's search terms.<br /><br />I used filesystemobject as follows and it gives physical links which does not open by clicking it.<br /><br />How can I get virtual path links which could be opened by clicking it by users?<br /><br /><%@ LANGUAGE = VBScript%><br /><% Option Explicit %><br /><br /> <br /><% <br />'Declare all our variables as it speeds things up and is generally good practice<br /> Dim strSearchText<br /> <br /><br /> on error resume next<br /> strSearchText = Request("SearchText")<br /> on error goto 0<br /><br />'Now, we want to search all of the files in the folder<br /><br /><br />Dim objFSO<br />Set objFSO = Server.CreateObject("Scripting.FileSystemObject")<br /><br /><br />Dim objFolder<br />Set objFolder = objFSO.GetFolder(Server.MapPath("../FDF"))<br /><br />Dim objFile<br /><br />For Each objFile in objFolder.Files<br /> <br /> If objFile.name = strSearchText then <br /><br /> Response.Write "Click the file name below to open the saved Data" "<BR>"<br /> Response.Write "<LI><A HREF=""/" & objFolder.Name & "/" &objFile.Name & """>" & objFile.Name & "</A><BR>"<br /> <br /> End If<br /><br />Next <br /> <br /><br />Set objFSO = Nothing<br />Set objFolder = Nothing<br />Set objFile = Nothing<br /><br />%><br /><br />
|