Forum Moderators: open

Message Too Old, No Replies

System hangs when trying to create or check for folder with ASP

System hangs when trying to create or check for folder with ASP

         

ImSir2U

8:47 pm on Nov 8, 2005 (gmt 0)

10+ Year Member



Hi,

I'm trying to check if a folder exists with my ASP code and all that happens is the system just appears to hang i.e. the page just sits there ticking away and never gets anywhere.

This is in a page that has been posted back to itself using a Mode = statement to process different bits of code.

At the top of the page an include is used to control the con.open statement which is as follows:

set con=Server.CreateObject( "ADODB.Connection" )
Set MyBrow=Server.CreateObject("MSWC.BrowserType")
con.Open "file name=c:\Inetpub\wwwroot\example.com\dining.udl"

The code that doesn't want to work is:

Set MyFileObject=Server.CreateObject("Scripting.FileSystemObject")
if MyFileObject.FolderExists("images\menu\Hello") = false then
MyFileObject.CreateFolder("images\menu\Hello")
end if

Once this code is processed the page is then redirected to another page to process a file upload using the response.redirect statement.

Any ideas why this is not working because every search I do about this and the books I have all indicate this is the way it is done.

Thanks

[edited by: Xoc at 1:50 pm (utc) on Nov. 12, 2005]
[edit reason] Changed to use example.com [/edit]

ImSir2U

9:17 pm on Nov 8, 2005 (gmt 0)

10+ Year Member



Update: I have tried some other things - new code is:

Set MyFileObject=Server.CreateObject("Scripting.FileSystemObject")
if MyFileObject.FolderExists(server.mappath("images\menu\hello")) = false then
response.write "Folder Does Not Exist!<br>"
MyFileObject.CreateFolder server.mappath("images\menu\Hello")
else
response.write "Folder Does Exist!<br>"
end if

If I comment out the createfolder line I get the "Folder does not exist!" message if I remove the \hello off the end of the FolderExists line I get the "Folder does exist!" message (which is correct). It is only when I put the CreateFolder line in that the system just sits and does nothing...

Any help please?

Thanks

mattglet

11:20 pm on Nov 8, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Check to make sure your IIS account has sufficient access to create folders on the server.

ImSir2U

11:45 pm on Nov 8, 2005 (gmt 0)

10+ Year Member



Hi,

Thanks for your help.

I have checked this. Since makingthis post I have done even more fiddling and it now works on my Windows 2000 Advanced Server machine but not on my Windows xp Pro laptop (which is where I do all my development). I'm wondering if there is a different command to use just like CDONTS had to be changed to CDO to work both under XP and W2KAdvSvr.

Any more thoughts?

Thanks.

ImSir2U

12:48 am on Nov 9, 2005 (gmt 0)

10+ Year Member



Hey, I fixed it, thanks to some guys in another forum. The problem was the script blocking in my Mcafee - once I found and disabled this it is all working.

Thanks for your willingness to help - it's really appreciated... :-)