Be sure that your IUSR account has NTFS permission to access that file.
Read-rights at least.

Ray at work

> -----Original Message-----
> From: [email protected] 
> [mailto:[EMAIL PROTECTED] On Behalf Of anthrax911
> Sent: Thursday, May 12, 2005 9:01 AM
> To: [email protected]
> Subject: [ASP] Retrieve file attributes not working for me
> 
> 
> I am trying to retrieve the 'last modified' property of a file on the 
> IIS server.  I pull the filename from a field in a database and put 
> the path into a variable.
> 
> 1)
> dim myname
> myname = objRSReport("Path")
> response.write myname
> 
> ^-The above response.write looks like this: d:\rb\Reports\test.rpt
> 
> 
> 2)
> This is my code to get the last modified date:
> 
> Dim fs,f
> Set fs=Server.CreateObject("Scripting.FileSystemObject")
> Set f=fs.GetFile(myname)
> Response.Write(" File created: " & f.DateCreated)
> set f=nothing
> set fs=nothing
> 
> ^-This returns a 'File Not Found' error.
> 
> 
> 3)
> But if I hardcode the path as follows it works, how come?
> 
> Dim fs,f
> Set fs=Server.CreateObject("Scripting.FileSystemObject")
> Set f=fs.GetFile("d:\rb\Reports\test.rpt")
> Response.Write(" File created: " & f.DateCreated)
> set f=nothing
> set fs=nothing
> 
> 
> 
> 
> 
> 
> 
> 
> --------------------------------------------------------------
> -------    
>  Home       : http://groups.yahoo.com/group/active-server-pages
> ---------------------------------------------------------------------
>  Post       : [email protected]
>  Subscribe  : [EMAIL PROTECTED]
>  Unsubscribe: [EMAIL PROTECTED]
> --------------------------------------------------------------------- 
> Yahoo! Groups Links
> 
> 
> 
>  
> 
> 
> 




---------------------------------------------------------------------    
 Home       : http://groups.yahoo.com/group/active-server-pages
---------------------------------------------------------------------
 Post       : [email protected]
 Subscribe  : [EMAIL PROTECTED]
 Unsubscribe: [EMAIL PROTECTED]
--------------------------------------------------------------------- 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/active-server-pages/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to