Click to See Complete Forum and Search --> : FileSystemObject problem


jjj
02-29-2008, 03:47 PM
Hi,

I am calling FileExists function on object of FileSystemObject.
But I get always a false value even if the file exists.

the file resides on my local machine. following is the snippet of my script..

........

inputfile = "C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\WebSites\iMusic\Files\Encoded\a-Windows_XP_Notify.wmv"

Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
DoesFileExist = objFSO.FileExists(inputfile)
Response.write(DoesFileExist)

...............

please help me out.. i m kind of new here!!

idsanjeev
02-29-2008, 10:43 PM
Hi friends
try this and
Function DoesFileExist(FilePath As String, Optional FileAttr As VbFileAttribute) As Boolean
If Len(Dir$(FilePath, FileAttr)) > 0 Then DoesFileExist = True Else DoesFileExist = False
End Function



and more about the file
New trend in filehttp://aspalliance.com/1423_ColdFusion_8_Setting_a_New_Trend_in_File_Operations.3
Let me know

itHighway2007
03-04-2008, 09:28 AM
The file system script is fine, no problem in it. Make sure your path is correct.