I am not sure if this issue is a permissions or code problem. Whenever I run my script I get the following error.

Microsoft VBScript runtime error '800a004c'

Path not found

/build-your-own-report/stjreport/includes/includes.inc, line 16

Line 16 in my includes file is getting the url path to the temp folder. The code looks like this.

`

set incFO = incFS.GetFolder(tmp_path)

`
Path is being set here

tmp_path = server.MapPath("/") & webDir & "/temp"

And here is the entire code

<%
    thisPage = Request.ServerVariables("SCRIPT_NAME")
    thisPage = Right(thisPageName,Len(thisPage) - InStrRev(thisPage,"/"))

    session.timeout = 5
    webDir = "/stjreport"
    pdf_path = server.MapPath("/") & webDir & "/pdfs"
    tmp_path = server.MapPath("/") & webDir & "/temp"

    Function RoundUp(n)
        roundUp = Int(n) - CBool(CDbl(n) <> CLng(n))
    End Function

    Sub cleanItUp(tt) 
        set incFS = server.createobject("scripting.FileSystemObject")
    /*line 16*/    set incFO = incFS.GetFolder(tmp_path)
        for each incF in incFO.files
            'if instr(1,incF.name,".pdf",1) > 0 then
                set tmpF = incFS.GetFile(incF)
                if DateDiff("s",tmpF.DateCreated,now) > tt then incFS.deleteFile(tmpF)
            'end if
        next
        set incFO = nothing
        set incFS = nothing
    End Sub

    Function makeRandomString(incLength)
        makeRandomString = ""
        seedStr = "1,N,O,P,Q,3,W,X,Y,Z,$,4,0,A,B,C,D,E,F,8,G,H,I,J,5,6,7,9,K,L,M,R,2,S,U,V,T,"
        rndAry = Split(seedStr,",")
        rndName = ""    
        For inc = 1 to incLength
            Randomize
            iRandom = Int( UBound( rndAry ) * Rnd )
            rndName = rndName & rndAry( iRandom )
        next
        makeRandomString = rndName
    End Function    

    Sub displayMessage  (incMsg,incReturnUrl)
        if Len(incMsg) > 0 then
            Response.write("<br /><br /><p style='text-align:center; font-family:arial; font_size:larger;'>" & incMsg & "</p>")
%>
<script language="javascript">
            alert("<%=Replace(Replace(incMsg,"<br />","\n"),"<br>","\n")%>");
<%
            if Len(incReturnUrl) > 0 then
%>                      
                top.location.href = "<%=incReturnUrl%>";
<%
            else
%>
                top.history.go(-1);
<%
            end if
%>                                                  
</script>
<%
            Response.end()
        end if                      
    End Sub             

    Function isPermittedFile(incFileType,incFile)   
        incFile = replace(incFile, "\", "/")
        if inStr(incFile,"/") > 0 then
            incAry = split(incFile,"/")
            incFile = incAry(uBound(incFile)-1)
        end if
        if inStr(incFile,".") = 0 then call (displayMessage("Image file: " & incFile & " sounds not to be a recognized image format",""))
        incFileAry = split(incFile,".")
        incExt = incFileAry(1)

        Select Case LCase(incFileType)
            Case "image"
                incAllowedStr = ",gif,png,jpg,jpeg,bmp,tiff,"
            Case "document"
                'incAllowedStr = ",pdf,doc,docx,txt,rtf,doc,docx,xls,xlsx,"
                incAllowedStr = ",pdf,"
        End Select
        isPermittedFile = False
        if inStr(1,incAllowedStr,","& LCase(incExt) &",",1) > 0 then isPermittedFile = True
    End Function

%>
Member Avatar for LastMitch

Line 16 in my includes file is getting the url path to the temp folder. The code looks like this.

There is something wrong with your path to that folder.

Are you using this on localhost (on your own computer) or hostserver (your internet provider)?

Can you post your whole path url?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.