Wrox Programmer Forums
|
ASP Forms As of Oct 5, 2005, this forum is now locked. Please use "Classic ASP beginner" at http://p2p.wrox.com/forum.asp?FORUM_ID=54 or "Classic ASP Professional" http://p2p.wrox.com/forum.asp?FORUM_ID=56 instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Forms section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 26th, 2003, 09:07 PM
Authorized User
 
Join Date: Aug 2003
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to wenzation
Default Physcial and Virtual path in Intranet!

I've got this problem. Currently, i'm in an intranet where i have mapping to this folder amsweb02... All coding is done inside this folder, however i'm required to do a Search Engine to search through a local drive folder (K:\public) for pdf files... Coding shouldn't be a problem right now, what the error was, [u]" The Path Parameter for the MapPathmethod must be a virtual path, A physical path was used."</u> :(

I'm using WIN XP, i got no idea how to map... There is a total of 7000+ pdf files to search through, so i don't think i can copy and paste all these files into the amsweb02 folder! Please Help!!!!

i'm a beginner, hoping to learn more.. please help... thanks a lot
__________________
i\'m a beginner, hoping to learn more.. please help... thanks a lot
 
Old August 27th, 2003, 02:53 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

You can either set up a virtual directory under amsweb02 which points to k:\public, or you can do away with the MapPath part and just use the physical location directly.
 
Old August 27th, 2003, 03:47 AM
Authorized User
 
Join Date: Aug 2003
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to wenzation
Default

you trying to say i can use physical path instead? how do i do that? not using filesystemboject right?

and how do i set up a virtual directory under amsweb02 which will be pointed to k:\public? is there special codings for this? or?

i'm a beginner, hoping to learn more.. please help... thanks a lot
 
Old August 27th, 2003, 04:21 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

FileSystemObject will happily take a physical path.

The easiest way to create a virtual directory is using the Internet Services Manager. Here's a microsoft article that explains how to do it for all version of IIS (since you have XP, you will have IIS 5.1)
http://support.microsoft.com/default...172138&sd=tech
 
Old August 27th, 2003, 07:39 PM
Authorized User
 
Join Date: Aug 2003
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to wenzation
Default

filesystemobject doesn't work.. it gives me this error of using physical path instead of virtual path.. that's why i don't think it works... as work IIS, i'm already in an intranet amsweb02, can i map to another folder when i already have one mapping of the amsweb02 done by the intranet?

i'm a beginner, hoping to learn more.. please help... thanks a lot
 
Old August 28th, 2003, 03:02 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

Which methods of FileSystemObject are you using? can you post some code?

Re the virtual directory - I meant that you could create a virtual dir under the root dir so you would have:
amsweb02 - same as you have now
amsweb02/pdf - points to k:\public

then you could use filesystemobject.someMethod( Server.MapPath("pdf") )
 
Old August 31st, 2003, 08:26 PM
Authorized User
 
Join Date: Aug 2003
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to wenzation
Default

<%
Const fsoForReading = 1

Dim strSearchText
strSearchText = Request.Form("SearchText")

'Now, we want to search all of the files
Dim objFSO
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")


Dim objFolder
Set objFolder = objFSO.GetFolder(Server.MapPath("/dept/quality/test/"))

'Declare the variables used to compare the
'textstring with the details of files in the folder
Dim objFile, objTextStream, strFileContents, bolFileFound
bolFileFound = False

'Searching through each different files' name
For Each objFile in objFolder.Files
  If Response.IsClientConnected then
  strFileContents = objFile.Name

    'Comparing file name with the textstring
    If InStr(1,strFileContents,strSearchText,1) then
        Response.Write "<LI><A HREF=""http://amsweb02/dept/quality/test/" & objFile.Name & _
                      """>" & objFile.Name & "</A><BR>"

       bolFileFound = True
    End If

  End If
Next

if Not bolFileFound then Response.Write "No matches found...<br>Tip: Check your P/N or component number again carefully!"




Set objTextStream = Nothing
Set objFolder = Nothing
Set objFSO = Nothing
%>


i'm a beginner, hoping to learn more.. please help... thanks a lot





Similar Threads
Thread Thread Starter Forum Replies Last Post
Page 239 Virtual Path Property normowen BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 3 November 15th, 2008 07:16 PM
Virtual Path property ksmanand ASP.NET 3.5 Basics 2 October 5th, 2008 10:49 AM
The virtual path maps to another application deeptisingh20 ASP.NET 1.0 and 1.1 Basics 2 August 8th, 2006 07:05 AM
windows server VIRTUAL - Disallowed Parent Path crmpicco Classic ASP Professional 2 June 29th, 2006 10:54 AM
coding for how to know the virtual path of drive satya_tripathy C# 0 November 15th, 2005 01:19 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.