Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Server.MapPath Object Question

Reply
Thread Tools

Server.MapPath Object Question

 
 
Chris Guimbellot
Guest
Posts: n/a
 
      04-09-2004
Hello,

ASP, VBScript, IIS5.

I have used the Server.MapPath object in the past in my web sites. What I am
trying to do is before I map a path, to see if the folder is there. If so,
map it. If not, do something else.

Is there a way to do this? I tried the following:

If Server.MapPath("testfolder") = True Then
Set objFile = Server.MapPath("testfolder")
End If

but of course that doesn't work because MapPath doesn't support a Boolean
value. Any ideas on what I need to do to accomplish this? Thanks,

Chris


 
Reply With Quote
 
 
 
 
Chris Guimbellot
Guest
Posts: n/a
 
      04-09-2004
Andrew,

Thanks for such a quick response. I had just thought about that. I
appreciate it. Thanks again.

Chris

"Andrew Urquhart" <(E-Mail Removed)> wrote in message
news:qiFdc.134$(E-Mail Removed)...
> Chris Guimbellot wrote:
> > I have used the Server.MapPath object in the past in my web sites.
> > What I am trying to do is before I map a path, to see if the folder
> > is there. If so, map it. If not, do something else.
> >
> > Is there a way to do this? I tried the following:
> >
> > If Server.MapPath("testfolder") = True Then
> > Set objFile = Server.MapPath("testfolder")
> > End If
> >
> > but of course that doesn't work because MapPath doesn't support a
> > Boolean value. Any ideas on what I need to do to accomplish this?

>
> Use the FolderExist method of the FileSystemObject in conjunction with
> Server.MapPath. The return value of FolderExist() is the Boolean you're
> looking for in your example.
> --
> Andrew Urquhart
> - Contact: www.andrewu.co.uk/contact/
> - Employ me: Front/middle tier ASP developer with WAI & web standards
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dumb question: in documentation, why Object#method, and not Object.method ? Elf M. Sternberg Ruby 15 07-29-2009 01:20 AM
why should base class object points to derived class object (virtualfunction question) ? DanielJohnson C++ 7 01-17-2009 10:15 PM
a basic question about Object, Object& gg9h0st C++ 4 10-24-2006 07:00 AM
Object creation - Do we really need to create a parent for a derieved object - can't the base object just point to an already created base object jon wayne C++ 9 09-22-2005 02:06 AM
Question: Object Reference not set to an instance of an object. =?Utf-8?B?TWFubnkgQ2hvaGFu?= ASP .Net 4 01-03-2005 09:54 PM



Advertisments