Click to See Complete Forum and Search --> : Why do I have this error?


ozpo1
03-13-2006, 09:22 PM
This is the code I'm using it's for AIM method:

<%
' Begin code to get the last modified date of the current document
' Get the location of the root directory for the server
file_info = request.servervariables("appl_physical_path")
' Get the location of the current file on the server
file_info = file_info + right(request.servervariables("script_name"),(len(request.servervariables("script_name"))-1))
' create a file scripting object on the server
set fso = createobject("scripting.filesystemobject")
' Assign a variable to contain the document date last modified
document_date=fso.getfile(file_info).datelastmodified
response.write "This code was last updated: "

This is the error I receive:
Microsoft VBScript runtime error '800a0035'

File not found

/getcontr/aim.asp, line 501
Line 501 is bold.
Can someone help me understand what's wrong with it, and how to fix it? Thanks in advanced,Oz.

JayM
03-13-2006, 10:06 PM
I wrote a similar script for an application I'm currently developing. Here's the code.



Dim strPathInfo, strPhysicalPath

strPathInfo = Request.ServerVariables("PATH_INFO")
strPhysicalPath = Server.MapPath(strPathInfo)

Dim objFSO, objFile
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.GetFile(strPhysicalPath)

objFile.DateLastModified



Edit: I guess it would be helpful to tell you where you probably went wrong.

APPL_PHYSICAL_PATH retrieves something like this: D:\Webs\WebDeveloper\www\

SCRIPT_NAME retrives something like:

/aspforum/sample.asp

If you concatenate these two strings, you will get this:

D:\Webs\WebDeveloper\www\/aspforum/sample.asp

Of course that path does not exist, which is why you got the error.

ozpo1
03-13-2006, 11:07 PM
As always, I Appreciate your time.

JayM
03-14-2006, 03:35 PM
You're welcome :)