FileSystemObject Error...FAQ's not helping...

Results 1 to 7 of 7

Thread: FileSystemObject Error...FAQ's not helping...

  1. #1
    Join Date
    Dec 1969
    Posts
    541

    Default FileSystemObject Error...FAQ's not helping...

    I am trying to get the files from a particular directory...I am using a virtual directory to try to access...<BR><BR>DocShelbyListDestLS = "DocumentsShelbyTest\"<BR>DocShelbyListSourceL S = "DocumentsShelbyImported\"<BR><BR>Set fsDocShelbyParent = Server.CreateObject("Scripting.FileSystemObject")< BR><BR>Set fsDocShelbyFolder = fsDocShelbyParent.GetFolder(DocShelbyListSourceLS) <BR><BR>I get Server.CreateObject failed on the above line...I can&#039;t seem to get understanding from FAQ&#039;s...I know this is easy...<BR><BR>KLC

  2. #2
    Join Date
    Dec 1969
    Posts
    96,118

    Default Server.MapPath

    You said it yourself: You are using a *virtual* directory.<BR><BR>FSO *only* works with actual file/path names.<BR><BR>So:<BR><BR>Set fsDocShelbyFolder = fsDocShelbyParent.GetFolder( Server.MapPath(DocShelbyListSourceLS) )<BR><BR>

  3. #3
    Join Date
    Dec 1969
    Posts
    541

    Default I'm Retarded...

    Thanks Bill...<BR><BR>Could I also map a drive on the server and use the actual path...<BR><BR>KLC

  4. #4
    Join Date
    Dec 1969
    Posts
    96,118

    Default Never tried it...

    ...but reports say it should work.<BR><BR>But don&#039;t forget about permissions.<BR><BR>


  5. #5
    Join Date
    Dec 1969
    Posts
    541

    Default Server.MapPath Better ???

    Which is the best way to go...I would think Server.MapPath...

  6. #6
    Join Date
    Dec 1969
    Posts
    96,118

    Default The point of MapPath...

    ...is that you can move the actual directory anywhere you want/need (e.g., maybe your C: drive is running out of space?), set the virtual directory to point to the new location, do the Server.MapPath, and it continues to work without needing to change your ASP code.<BR><BR>If you *know* you will *NEVER* move a directory (ha! liar!), then go ahead and use a physical path.<BR><BR>

  7. #7
    Join Date
    Dec 1969
    Posts
    541

    Default uDaMan...I knew that...Just brain dead...

    You are the man Bill...I knew that...I just am brain dead on this Monday...<BR><BR>Thanks again...<BR><BR>KLC

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •