p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Classic ASP Basics (http://p2p.wrox.com/forumdisplay.php?f=61)
-   -   File System Object in Server Side (http://p2p.wrox.com/showthread.php?t=7510)

stalker December 22nd, 2003 01:02 AM

File System Object in Server Side

I have this function.. It always worked.. now it doesn't and I don't know why coz I don't think I changed anything in my server.. I already instaled WinXp Pro in a brand new PC and tested the site but the error still appears...

What happens is that I am trying to use ASP File System Object and if I try to use the method FileExists or any other ordinary method it woks fine.. But it I try to get the handle to a File or Folder with the GetFile or GetFolder methods the site getts lazzy and doesn't open! It never returns an error.. but stays there for a long time.. Until i give up! I don't think there's nothing wrong with the script.. It works fine in Client Side.. but in Server side.. maybe you can help me.. It halts in the GetFolder statement! Thx

function listfolders() {
    var styles = new Array();

    Dim ObjFSO, StyleCounter
    Dim objFolder
    Set ObjFSO = Server.CreateObject("Scripting.FileSystemObject")
    Set objFolder = objFSO.GetFolder(Server.MapPath("..\style\")) ''here!!
    StyleCounter = 0

    For Each objStyle in objFolder.SubFolders
        Response.write "(blablabla)"
        StyleCounter = StyleCounter + 1
    return styles;

Imar December 22nd, 2003 06:39 AM

Hi there,

Are you running programs like Norton Antivirus or McAfee Antivirus?
If so, check the options dialog for a feature called Script Blocking or something similar. This option blocks .vbs scripts and the FileSystemObject. If this seems to be the problem, it's up to you wether you want to sacrifice some security for the features of the FSO.



Imar Spaanjaars
Everyone is unique, except for me.

stalker December 22nd, 2003 09:48 AM

AHAHAAH!!! thx man!!! I never figured out why it all stop working at the same time at all my 3 computers!! ahaahah now that you told me that I remember that I installed Norton at the same time in all the computers!!!

THX!! Will check it out!!

All times are GMT -4. The time now is 11:44 PM.

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