#1
  1. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Jan 2012
    Posts
    16
    Rep Power
    0

    Question Open a folder from an ASP page


    Hi I have to open a folder from an ASP page and it depends on the user having access to the folder and if it doesn not have any access then redirect it to the different folder .

    Now i have a problem that wen i click on the link it gives me blank page and it does not show anything

    Can someone help please

    Below is the code

    <%

    on error resume next
    %>
    <script language="javascript">
    <!--
    function checkURL(url)
    {
    try
    {
    var http = new XMLHttpRequest();
    http.open('HEAD', url, false);
    http.send();
    alert(http.status);
    if (((http.status >= 100) && (http.status < 400)) || (http.status == 12029))
    {
    alert("BlueBird access available");
    return true;
    }
    }
    catch(err)
    {
    alert("Error123 : " + err.description);
    return false;
    }
    alert("No Access to BlueBird");
    return false;
    }
    //-->
    </script>

    <% if request("SD") = "" then
    Response.Write("<script type='text/javascript'>if (checkURL('//bluebird/xxxxxxxx/')==true){location.href ='file://bluebird/xxxxxxx/'} else {location.href = 'BlueBirdAccess.asp?SD=1'};</script>")
    end if
    %>

    <% if request("SD") = 1 then
    BlueBirdTPICE = "file://xxxxxxx/xxxxxxx"
    dim fs,fo
    set fs=Server.CreateObject("Scripting.FileSystemObject ")
    set fo=fs.GetFolder("//xxxxxxx/xxxxxxx")
    FolderAttr = ""
    FolderAttr = fo.Attributes

    If (FolderAttr) = "16" then
    %>
    <script language="javascript">
    <!--
    alert("tpICE folder access available");
    location.href = "<%=BlueBirdTPICE%>";
    //-->
    </script>
    <%
    Else

    End if

    set fo=nothing
    set fs=nothing

    end if
    %>

    <%
    if err then
    'response.write (err.description)
    end if
    %>
  2. #2
  3. Contributing User
    ASP Skiller (1500 - 1999 posts)

    Join Date
    Mar 2005
    Location
    Columbus, OH
    Posts
    1,548
    Rep Power
    278
    What you expect to see? What value you have for if request("SD") ?
    Code
    if request("SD") = "" then
    Response.Write("<script type='text/javascript'>if (checkURL('//bluebird/xxxxxxxx/')==true){location.href ='file://bluebird/xxxxxxx/'} else {location.href = 'BlueBirdAccess.asp?SD=1'};</script>")
    end if
    does no looks right...
    GK
    __________________________________________________ _____
    if you found this post is useful click Give Rep button (bottom side on this reply ) and agree
  4. #3
  5. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Jan 2012
    Posts
    16
    Rep Power
    0
    Hi,

    Thanks for your reply but i am able to get through that code

    Now

    I used

    window.open("file:///xxxxxxx/xx%20xx%20xx");

    but it says that "Access is denied" but i am able to access the folder from Run in my system, It a shared network drive.Can you help me Thanks
  6. #4
  7. Contributing User
    ASP Skiller (1500 - 1999 posts)

    Join Date
    Mar 2005
    Location
    Columbus, OH
    Posts
    1,548
    Rep Power
    278
    file:// pointed to file on your local computer it iss not for web...
    and another point. On your local computer even in browser system knows your credentials, but from the web you came in as iis user with iis user credentials.... unless you enable windows authentication...

Similar Threads

  1. Local folder not open in ASP
    By puneet_pr in forum ASP Development
    Replies: 1
    Last Post: November 15th, 2011, 07:10 AM
  2. 98% files on folder do not open
    By Severson in forum Windows OS
    Replies: 3
    Last Post: March 3rd, 2010, 06:58 PM
  3. Open URL/Link as a Web Folder
    By matthuxtable in forum HTML, JavaScript And CSS Help
    Replies: 5
    Last Post: May 22nd, 2005, 10:35 AM
  4. how to save asp page to a folder ?
    By Steve Schofield in forum ASP Development
    Replies: 1
    Last Post: February 12th, 2002, 07:00 AM
  5. Open a folder from an ASP file
    By Steve Schofield in forum HTML, JavaScript And CSS Help
    Replies: 2
    Last Post: December 10th, 2001, 12:28 PM

IMN logo majestic logo threadwatch logo seochat tools logo