Find file on virtual path

sl1nger used Ask the Experts™
I'm trying to find a file on a virtual directory.

Currently, it works with the root and actual directory path, using fileexsits.

fileExists = fso.FileExists("D:\wwwroot\prodftp\" & fileName)

I'd like to find the file using the virtual directory 'ftppub'.

??? fileExists = fso.FileExists("\\ftppub\" & fileName)
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
\\ftppub\ is a UNC path.

fileExists = fso.FileExists(Server.MapPath("/ftppub")  & fileName)
Err, typo.  Should read:
fileExists = fso.FileExists(Server.MapPath("/ftppub")  & "\" & fileName)


sorry. the virtual path is prodftp not ftppub
Learn Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.


I tried this.. fileExists = fso.FileExists(Server.MapPath("/prodftp") & "\" & fileName)
it doesn't find the file

fileExists = fso.FileExists(Server.MapPath("/prodftp/" & filename))
Server.MapPath("/prodftp") works for me.

Try this to show the path on the screen:
Response.write Server.MapPath("/prodftp") & "\"  & fileName
Has this issue been resolved?

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial