Results 1 to 13 of 13

Thread: IIS, hangs on opening file...

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2000
    Location
    Kalix, Norrbotten, SWEDEN
    Posts
    343

    IIS, hangs on opening file...

    Why does my IIS hangs when I run this code...

    <%
    filespec = "test.html"
    filespec = server.mapPath(filespec)
    scr = "scripting.fileSystemObject"
    set fs = server.createobject(scr)
    set f = fs.openTextFile(filespec) THIS HANGS THE IIS
    content = f.readall
    set f = nothing
    set fs = nothing
    response.write(content)
    %>


    I run Win XP and IIS 5.1

    I have tested this code on my ISP, and if functions good there. Bu they run a lower version of IIS, because the Server.Execute doesnt work there.

    What could be the problem, the file path is correct.

    Can someone with Win XP and IIS 5.1 please verify that this does not work??

    /Smirre
    Visual Basic
    C, C++
    Java
    Access
    SQL Server

    MCP, MCSD

  2. #2
    Fanatic Member punkpie_uk's Avatar
    Join Date
    Sep 2001
    Location
    UK
    Posts
    645
    Try using OpenTextFile instead. I know it definatly works with IIS 5 on win XP

    I believe this is : -
    1 for reading
    2 for writing
    3 for modifying

    Set FS = Server.CreateObject("Scripting.FileSystemObject")
    Set RS = FS.OpenTextFile(Server.MapPath("file.dat"),1)
    content = f.readall
    RS.Close
    Set FS = Nothing
    Set RS = Nothing
    response.write content
    SPREAD THE WORD!!! Are You Lee McCormick? Because I Am



    Lee M McCormick
    [email protected]

    Lee McCormick.com - Live
    Dynamically Webbed.com - In development but live

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    May 2000
    Location
    Kalix, Norrbotten, SWEDEN
    Posts
    343
    No, good....

    I must proberly reinstall the IIS.....


    /Smirre
    Visual Basic
    C, C++
    Java
    Access
    SQL Server

    MCP, MCSD

  4. #4
    PowerPoster
    Join Date
    Nov 2001
    Location
    Trying to reach and stay in the cloud
    Posts
    2,089

    hi

    Reinstalling the IIS wont help.

    With IIS 5.0, i.e the version which ships with windows 2000.win xp. by default the write permissions are not given in the root folder.

    The code is alright.

    What u need to do is disable simple sharing for the root folder and give modify permissions to the IWAM user.

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    May 2000
    Location
    Kalix, Norrbotten, SWEDEN
    Posts
    343
    Nope, that didnt work......

    Anything else I can check???

    /Smirre
    Visual Basic
    C, C++
    Java
    Access
    SQL Server

    MCP, MCSD

  6. #6
    PowerPoster
    Join Date
    Nov 2001
    Location
    Trying to reach and stay in the cloud
    Posts
    2,089

    hi

    It has to be that. cant be any other reason. post back the settings what u have made so far.

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    May 2000
    Location
    Kalix, Norrbotten, SWEDEN
    Posts
    343
    I will take some snap shots. Should I mail you or should I just post hem??

    /Smirre
    Visual Basic
    C, C++
    Java
    Access
    SQL Server

    MCP, MCSD

  8. #8
    PowerPoster
    Join Date
    Nov 2001
    Location
    Trying to reach and stay in the cloud
    Posts
    2,089
    Whatever u prefer.

  9. #9

    Thread Starter
    Hyperactive Member
    Join Date
    May 2000
    Location
    Kalix, Norrbotten, SWEDEN
    Posts
    343
    The properties dialog of the webserver...
    Attached Images Attached Images  
    Visual Basic
    C, C++
    Java
    Access
    SQL Server

    MCP, MCSD

  10. #10

    Thread Starter
    Hyperactive Member
    Join Date
    May 2000
    Location
    Kalix, Norrbotten, SWEDEN
    Posts
    343
    Home directory of the webserver..
    Attached Images Attached Images  
    Visual Basic
    C, C++
    Java
    Access
    SQL Server

    MCP, MCSD

  11. #11

    Thread Starter
    Hyperactive Member
    Join Date
    May 2000
    Location
    Kalix, Norrbotten, SWEDEN
    Posts
    343
    Directory security of the webserver...
    Attached Images Attached Images  
    Visual Basic
    C, C++
    Java
    Access
    SQL Server

    MCP, MCSD

  12. #12
    PowerPoster
    Join Date
    Nov 2001
    Location
    Trying to reach and stay in the cloud
    Posts
    2,089

    not the IIS settings

    Navigate to your root folder in windows explorer and right click on the root folder - select sharing and security tab. (If you have disbaled simple permissions type then only can you be able to see the securities tab). then add the following users -- iwam and iusr. give them the modify permissions.

    Post back if you want more info.

  13. #13
    PowerPoster
    Join Date
    Nov 2001
    Location
    Trying to reach and stay in the cloud
    Posts
    2,089

Posting Permissions

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



Click Here to Expand Forum to Full Width